/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('aiccs', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddHotlineNumberRequest {
  description?: string(name='Description', description='This parameter is required.', example='desc'),
  enableInbound?: boolean(name='EnableInbound', description='This parameter is required.', example='true'),
  enableInboundEvaluation?: boolean(name='EnableInboundEvaluation', description='This parameter is required.', example='true'),
  enableOutbound?: boolean(name='EnableOutbound', description='This parameter is required.', example='true'),
  enableOutboundEvaluation?: boolean(name='EnableOutboundEvaluation', description='This parameter is required.', example='true'),
  evaluationLevel?: int32(name='EvaluationLevel', example='2'),
  hotlineNumber?: string(name='HotlineNumber', description='This parameter is required.', example='05710000****'),
  inboundFlowId?: long(name='InboundFlowId', example='123456'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  outboundAllDepart?: boolean(name='OutboundAllDepart', description='This parameter is required.', example='true'),
  outboundRangeList?: [ 
    {
      departmentId?: long(name='DepartmentId', example='123456'),
      groupIdList?: [ long ](name='GroupIdList'),
    }
  ](name='OutboundRangeList'),
}

model AddHotlineNumberShrinkRequest {
  description?: string(name='Description', description='This parameter is required.', example='desc'),
  enableInbound?: boolean(name='EnableInbound', description='This parameter is required.', example='true'),
  enableInboundEvaluation?: boolean(name='EnableInboundEvaluation', description='This parameter is required.', example='true'),
  enableOutbound?: boolean(name='EnableOutbound', description='This parameter is required.', example='true'),
  enableOutboundEvaluation?: boolean(name='EnableOutboundEvaluation', description='This parameter is required.', example='true'),
  evaluationLevel?: int32(name='EvaluationLevel', example='2'),
  hotlineNumber?: string(name='HotlineNumber', description='This parameter is required.', example='05710000****'),
  inboundFlowId?: long(name='InboundFlowId', example='123456'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  outboundAllDepart?: boolean(name='OutboundAllDepart', description='This parameter is required.', example='true'),
  outboundRangeListShrink?: string(name='OutboundRangeList'),
}

model AddHotlineNumberResponseBody = {
  code?: string(name='Code', example='Success'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE339D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model AddHotlineNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddHotlineNumberResponseBody(name='body'),
}

/**
 * @summary 新增热线号码
 *
 * @param tmpReq AddHotlineNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddHotlineNumberResponse
 */
async function addHotlineNumberWithOptions(tmpReq: AddHotlineNumberRequest, runtime: Util.RuntimeOptions): AddHotlineNumberResponse {
  Util.validateModel(tmpReq);
  var request = new AddHotlineNumberShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.outboundRangeList)) {
    request.outboundRangeListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.outboundRangeList, 'OutboundRangeList', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.enableInbound)) {
    body['EnableInbound'] = request.enableInbound;
  }
  if (!Util.isUnset(request.enableInboundEvaluation)) {
    body['EnableInboundEvaluation'] = request.enableInboundEvaluation;
  }
  if (!Util.isUnset(request.enableOutbound)) {
    body['EnableOutbound'] = request.enableOutbound;
  }
  if (!Util.isUnset(request.enableOutboundEvaluation)) {
    body['EnableOutboundEvaluation'] = request.enableOutboundEvaluation;
  }
  if (!Util.isUnset(request.evaluationLevel)) {
    body['EvaluationLevel'] = request.evaluationLevel;
  }
  if (!Util.isUnset(request.hotlineNumber)) {
    body['HotlineNumber'] = request.hotlineNumber;
  }
  if (!Util.isUnset(request.inboundFlowId)) {
    body['InboundFlowId'] = request.inboundFlowId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.outboundAllDepart)) {
    body['OutboundAllDepart'] = request.outboundAllDepart;
  }
  if (!Util.isUnset(request.outboundRangeListShrink)) {
    body['OutboundRangeList'] = request.outboundRangeListShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddHotlineNumber',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新增热线号码
 *
 * @param request AddHotlineNumberRequest
 * @return AddHotlineNumberResponse
 */
async function addHotlineNumber(request: AddHotlineNumberRequest): AddHotlineNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return addHotlineNumberWithOptions(request, runtime);
}

model AddOuterAccountRequest {
  avatar?: string(name='Avatar', example='http://****'),
  ext?: string(name='Ext'),
  outerAccountId?: string(name='OuterAccountId', description='This parameter is required.', example='1212'),
  outerAccountName?: string(name='OuterAccountName'),
  outerAccountType?: string(name='OuterAccountType', description='This parameter is required.', example='alipay'),
  outerDepartmentId?: string(name='OuterDepartmentId', example='3'),
  outerDepartmentType?: string(name='OuterDepartmentType', example='type_invalid'),
  outerGroupIds?: string(name='OuterGroupIds', example='["222","333","444"]'),
  outerGroupType?: string(name='OuterGroupType', example='mybank'),
  realName?: string(name='RealName'),
}

model AddOuterAccountResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='123456'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model AddOuterAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddOuterAccountResponseBody(name='body'),
}

/**
 * @param request AddOuterAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddOuterAccountResponse
 */
async function addOuterAccountWithOptions(request: AddOuterAccountRequest, runtime: Util.RuntimeOptions): AddOuterAccountResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddOuterAccount',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request AddOuterAccountRequest
 * @return AddOuterAccountResponse
 */
async function addOuterAccount(request: AddOuterAccountRequest): AddOuterAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return addOuterAccountWithOptions(request, runtime);
}

model AddSkillGroupRequest {
  outerDepartmentId?: string(name='OuterDepartmentId', example='123456'),
  outerDepartmentType?: string(name='OuterDepartmentType', example='type_invalid'),
  outerGroupId?: string(name='OuterGroupId', description='This parameter is required.', example='123456'),
  outerGroupName?: string(name='OuterGroupName', description='This parameter is required.'),
  outerGroupType?: string(name='OuterGroupType', description='This parameter is required.', example='mybank'),
}

model AddSkillGroupResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='123456'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model AddSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddSkillGroupResponseBody(name='body'),
}

/**
 * @param request AddSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddSkillGroupResponse
 */
async function addSkillGroupWithOptions(request: AddSkillGroupRequest, runtime: Util.RuntimeOptions): AddSkillGroupResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddSkillGroup',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request AddSkillGroupRequest
 * @return AddSkillGroupResponse
 */
async function addSkillGroup(request: AddSkillGroupRequest): AddSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return addSkillGroupWithOptions(request, runtime);
}

model AiccsSmartCallRequest {
  actionCodeBreak?: boolean(name='ActionCodeBreak', example='true'),
  actionCodeTimeBreak?: int32(name='ActionCodeTimeBreak', example='120'),
  asrAlsAmId?: string(name='AsrAlsAmId', example='23387****'),
  asrBaseId?: string(name='AsrBaseId', example='customer_service_8k'),
  asrModelId?: string(name='AsrModelId', example='bf71664d30d2478fb8cb8c39c6b6****'),
  asrVocabularyId?: string(name='AsrVocabularyId', example='6689****'),
  backgroundFileCode?: string(name='BackgroundFileCode', example='2d4c-4e78-8d2a-afbb06cf****.wav'),
  backgroundSpeed?: int32(name='BackgroundSpeed', example='1'),
  backgroundVolume?: int32(name='BackgroundVolume', example='1'),
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='1862222****'),
  calledShowNumber?: string(name='CalledShowNumber', description='This parameter is required.', example='0571000****'),
  dynamicId?: string(name='DynamicId', example='2234****'),
  earlyMediaAsr?: boolean(name='EarlyMediaAsr', example='fasle'),
  enableITN?: boolean(name='EnableITN', example='true'),
  muteTime?: int32(name='MuteTime', example='10000'),
  outId?: string(name='OutId', example='222356****'),
  ownerId?: long(name='OwnerId'),
  pauseTime?: int32(name='PauseTime', example='800'),
  playTimes?: int32(name='PlayTimes', example='1'),
  prodCode?: string(name='ProdCode', example='aiccs'),
  recordFlag?: boolean(name='RecordFlag', example='true'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sessionTimeout?: int32(name='SessionTimeout', example='120'),
  speed?: int32(name='Speed', example='1'),
  ttsConf?: boolean(name='TtsConf', example='true'),
  ttsSpeed?: int32(name='TtsSpeed', example='100'),
  ttsStyle?: string(name='TtsStyle', example='xiaoyun'),
  ttsVolume?: int32(name='TtsVolume', example='10'),
  voiceCode?: string(name='VoiceCode', description='This parameter is required.', example='2d4c-4e78-8d2a-afbb06cf****.wav,$name$'),
  voiceCodeParam?: string(name='VoiceCodeParam'),
  volume?: int32(name='Volume', example='1'),
}

model AiccsSmartCallResponseBody = {
  code?: string(name='Code', example='116012854210^10281427****'),
  data?: string(name='Data', example='OK'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'),
}

model AiccsSmartCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AiccsSmartCallResponseBody(name='body'),
}

/**
 * @param request AiccsSmartCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AiccsSmartCallResponse
 */
async function aiccsSmartCallWithOptions(request: AiccsSmartCallRequest, runtime: Util.RuntimeOptions): AiccsSmartCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.actionCodeBreak)) {
    query['ActionCodeBreak'] = request.actionCodeBreak;
  }
  if (!Util.isUnset(request.actionCodeTimeBreak)) {
    query['ActionCodeTimeBreak'] = request.actionCodeTimeBreak;
  }
  if (!Util.isUnset(request.asrAlsAmId)) {
    query['AsrAlsAmId'] = request.asrAlsAmId;
  }
  if (!Util.isUnset(request.asrBaseId)) {
    query['AsrBaseId'] = request.asrBaseId;
  }
  if (!Util.isUnset(request.asrModelId)) {
    query['AsrModelId'] = request.asrModelId;
  }
  if (!Util.isUnset(request.asrVocabularyId)) {
    query['AsrVocabularyId'] = request.asrVocabularyId;
  }
  if (!Util.isUnset(request.backgroundFileCode)) {
    query['BackgroundFileCode'] = request.backgroundFileCode;
  }
  if (!Util.isUnset(request.backgroundSpeed)) {
    query['BackgroundSpeed'] = request.backgroundSpeed;
  }
  if (!Util.isUnset(request.backgroundVolume)) {
    query['BackgroundVolume'] = request.backgroundVolume;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.calledShowNumber)) {
    query['CalledShowNumber'] = request.calledShowNumber;
  }
  if (!Util.isUnset(request.dynamicId)) {
    query['DynamicId'] = request.dynamicId;
  }
  if (!Util.isUnset(request.earlyMediaAsr)) {
    query['EarlyMediaAsr'] = request.earlyMediaAsr;
  }
  if (!Util.isUnset(request.enableITN)) {
    query['EnableITN'] = request.enableITN;
  }
  if (!Util.isUnset(request.muteTime)) {
    query['MuteTime'] = request.muteTime;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pauseTime)) {
    query['PauseTime'] = request.pauseTime;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.prodCode)) {
    query['ProdCode'] = request.prodCode;
  }
  if (!Util.isUnset(request.recordFlag)) {
    query['RecordFlag'] = request.recordFlag;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sessionTimeout)) {
    query['SessionTimeout'] = request.sessionTimeout;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.ttsConf)) {
    query['TtsConf'] = request.ttsConf;
  }
  if (!Util.isUnset(request.ttsSpeed)) {
    query['TtsSpeed'] = request.ttsSpeed;
  }
  if (!Util.isUnset(request.ttsStyle)) {
    query['TtsStyle'] = request.ttsStyle;
  }
  if (!Util.isUnset(request.ttsVolume)) {
    query['TtsVolume'] = request.ttsVolume;
  }
  if (!Util.isUnset(request.voiceCode)) {
    query['VoiceCode'] = request.voiceCode;
  }
  if (!Util.isUnset(request.voiceCodeParam)) {
    query['VoiceCodeParam'] = request.voiceCodeParam;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AiccsSmartCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request AiccsSmartCallRequest
 * @return AiccsSmartCallResponse
 */
async function aiccsSmartCall(request: AiccsSmartCallRequest): AiccsSmartCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return aiccsSmartCallWithOptions(request, runtime);
}

model AiccsSmartCallOperateRequest {
  callId?: string(name='CallId', example='116012854210^102814279****'),
  command?: string(name='Command', example='parallelBridge'),
  ownerId?: long(name='OwnerId'),
  param?: string(name='Param', example='Param'),
  prodCode?: string(name='ProdCode', example='aiccs'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model AiccsSmartCallOperateResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='true'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'),
}

model AiccsSmartCallOperateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AiccsSmartCallOperateResponseBody(name='body'),
}

/**
 * @param request AiccsSmartCallOperateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AiccsSmartCallOperateResponse
 */
async function aiccsSmartCallOperateWithOptions(request: AiccsSmartCallOperateRequest, runtime: Util.RuntimeOptions): AiccsSmartCallOperateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.command)) {
    query['Command'] = request.command;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.param)) {
    query['Param'] = request.param;
  }
  if (!Util.isUnset(request.prodCode)) {
    query['ProdCode'] = request.prodCode;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AiccsSmartCallOperate',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request AiccsSmartCallOperateRequest
 * @return AiccsSmartCallOperateResponse
 */
async function aiccsSmartCallOperate(request: AiccsSmartCallOperateRequest): AiccsSmartCallOperateResponse {
  var runtime = new Util.RuntimeOptions{};
  return aiccsSmartCallOperateWithOptions(request, runtime);
}

model AnswerCallRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  callId?: string(name='CallId', example='7719786'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  connectionId?: string(name='ConnectionId', example='7719788'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  jobId?: string(name='JobId', example='7719787'),
}

model AnswerCallResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model AnswerCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AnswerCallResponseBody(name='body'),
}

/**
 * @param request AnswerCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AnswerCallResponse
 */
async function answerCallWithOptions(request: AnswerCallRequest, runtime: Util.RuntimeOptions): AnswerCallResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.callId)) {
    body['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionId)) {
    body['ConnectionId'] = request.connectionId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AnswerCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request AnswerCallRequest
 * @return AnswerCallResponse
 */
async function answerCall(request: AnswerCallRequest): AnswerCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return answerCallWithOptions(request, runtime);
}

model AttachTaskRequest {
  callString?: string(name='CallString'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model AttachTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: long(name='Data', example='10'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model AttachTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachTaskResponseBody(name='body'),
}

/**
 * @summary 追加任务明细
 *
 * @param request AttachTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachTaskResponse
 */
async function attachTaskWithOptions(request: AttachTaskRequest, runtime: Util.RuntimeOptions): AttachTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callString)) {
    query['CallString'] = request.callString;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 追加任务明细
 *
 * @param request AttachTaskRequest
 * @return AttachTaskResponse
 */
async function attachTask(request: AttachTaskRequest): AttachTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachTaskWithOptions(request, runtime);
}

model BatchCreateQualityProjectsRequest {
  analysisIds?: [ long ](name='AnalysisIds', description='This parameter is required.'),
  channelTouchType?: [ int32 ](name='ChannelTouchType'),
  checkFreqType?: int32(name='CheckFreqType', description='This parameter is required.'),
  instanceList?: [ string ](name='InstanceList', description='This parameter is required.'),
  projectName?: string(name='ProjectName', description='This parameter is required.'),
  timeRangeEnd?: string(name='TimeRangeEnd'),
  timeRangeStart?: string(name='TimeRangeStart'),
}

model BatchCreateQualityProjectsResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      instanceId?: string(name='InstanceId'),
      projectId?: long(name='ProjectId'),
      version?: int32(name='Version'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model BatchCreateQualityProjectsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchCreateQualityProjectsResponseBody(name='body'),
}

/**
 * @param request BatchCreateQualityProjectsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchCreateQualityProjectsResponse
 */
async function batchCreateQualityProjectsWithOptions(request: BatchCreateQualityProjectsRequest, runtime: Util.RuntimeOptions): BatchCreateQualityProjectsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.analysisIds)) {
    query['AnalysisIds'] = request.analysisIds;
  }
  if (!Util.isUnset(request.channelTouchType)) {
    query['ChannelTouchType'] = request.channelTouchType;
  }
  if (!Util.isUnset(request.checkFreqType)) {
    query['CheckFreqType'] = request.checkFreqType;
  }
  if (!Util.isUnset(request.instanceList)) {
    query['InstanceList'] = request.instanceList;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  if (!Util.isUnset(request.timeRangeEnd)) {
    query['TimeRangeEnd'] = request.timeRangeEnd;
  }
  if (!Util.isUnset(request.timeRangeStart)) {
    query['TimeRangeStart'] = request.timeRangeStart;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchCreateQualityProjects',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request BatchCreateQualityProjectsRequest
 * @return BatchCreateQualityProjectsResponse
 */
async function batchCreateQualityProjects(request: BatchCreateQualityProjectsRequest): BatchCreateQualityProjectsResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchCreateQualityProjectsWithOptions(request, runtime);
}

model CancelTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model CancelTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: boolean(name='Data', example='true'),
  message?: string(name='Message', example='Ok'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model CancelTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelTaskResponseBody(name='body'),
}

/**
 * @summary 删除智能外呼任务
 *
 * @param request CancelTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelTaskResponse
 */
async function cancelTaskWithOptions(request: CancelTaskRequest, runtime: Util.RuntimeOptions): CancelTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除智能外呼任务
 *
 * @param request CancelTaskRequest
 * @return CancelTaskResponse
 */
async function cancelTask(request: CancelTaskRequest): CancelTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelTaskWithOptions(request, runtime);
}

model ChangeChatAgentStatusRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='account1'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  method?: string(name='Method', description='This parameter is required.', example='requestLogout'),
}

model ChangeChatAgentStatusResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: string(name='Data', example='0'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='DF6A3FB7-A5AA-43BE-A65B'),
  success?: boolean(name='Success', example='true'),
}

model ChangeChatAgentStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeChatAgentStatusResponseBody(name='body'),
}

/**
 * @summary 修改在线客服状态
 *
 * @param request ChangeChatAgentStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeChatAgentStatusResponse
 */
async function changeChatAgentStatusWithOptions(request: ChangeChatAgentStatusRequest, runtime: Util.RuntimeOptions): ChangeChatAgentStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.method)) {
    body['Method'] = request.method;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ChangeChatAgentStatus',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改在线客服状态
 *
 * @param request ChangeChatAgentStatusRequest
 * @return ChangeChatAgentStatusResponse
 */
async function changeChatAgentStatus(request: ChangeChatAgentStatusRequest): ChangeChatAgentStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeChatAgentStatusWithOptions(request, runtime);
}

model ChangeQualityProjectStatusRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  projectId?: long(name='ProjectId', description='This parameter is required.'),
  status?: int32(name='Status', description='This parameter is required.'),
}

model ChangeQualityProjectStatusResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ChangeQualityProjectStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeQualityProjectStatusResponseBody(name='body'),
}

/**
 * @param request ChangeQualityProjectStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeQualityProjectStatusResponse
 */
async function changeQualityProjectStatusWithOptions(request: ChangeQualityProjectStatusRequest, runtime: Util.RuntimeOptions): ChangeQualityProjectStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeQualityProjectStatus',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ChangeQualityProjectStatusRequest
 * @return ChangeQualityProjectStatusResponse
 */
async function changeQualityProjectStatus(request: ChangeQualityProjectStatusRequest): ChangeQualityProjectStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeQualityProjectStatusWithOptions(request, runtime);
}

model CreateAgentRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='username@example.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  displayName?: string(name='DisplayName', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  skillGroupId?: [ long ](name='SkillGroupId'),
  skillGroupIdList?: [ long ](name='SkillGroupIdList'),
}

model CreateAgentResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: long(name='Data', example='2578****'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model CreateAgentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAgentResponseBody(name='body'),
}

/**
 * @param request CreateAgentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAgentResponse
 */
async function createAgentWithOptions(request: CreateAgentRequest, runtime: Util.RuntimeOptions): CreateAgentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.displayName)) {
    body['DisplayName'] = request.displayName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.skillGroupId)) {
    bodyFlat['SkillGroupId'] = request.skillGroupId;
  }
  if (!Util.isUnset(request.skillGroupIdList)) {
    bodyFlat['SkillGroupIdList'] = request.skillGroupIdList;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAgent',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateAgentRequest
 * @return CreateAgentResponse
 */
async function createAgent(request: CreateAgentRequest): CreateAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAgentWithOptions(request, runtime);
}

model CreateAiOutboundTaskRequest {
  concurrentRate?: int32(name='ConcurrentRate', example='10'),
  description?: string(name='Description'),
  executionTime?: string(name='ExecutionTime', description='This parameter is required.', example='{"TUESDAY":[{"start":"06:00","end":"06:05"}],"MONDAY":[{"start":"09:00","end":"18:00"},{"start":"20:30","end":"21:45"},{"start":"22:30","end":"22:50"}],"WEDNESDAY":[{"start":"09:00","end":"18:00"}],"THURSDAY":[{"start":"09:00","end":"18:00"}],"FRIDAY":[{"start":"09:00","end":"18:00"}],"SATURDAY":[{"start":"09:00","end":"18:00"}],"SUNDAY":[{"start":"17:00","end":"23:45"}]}'),
  forecastCallRate?: float(name='ForecastCallRate', example='1.5'),
  handlerId?: long(name='HandlerId', description='This parameter is required.', example='123456'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='cc_xp_pre-cn-***'),
  name?: string(name='Name', description='This parameter is required.', example='xx外呼任务'),
  numRepeated?: int32(name='NumRepeated', description='This parameter is required.', example='1'),
  outboundNums?: [ string ](name='OutboundNums', description='This parameter is required.'),
  recallRule?: {
    count?: int32(name='Count', example='1'),
    interval?: int32(name='Interval', example='1'),
  }(name='RecallRule'),
  type?: int32(name='Type', description='This parameter is required.', example='2', nullable=false),
}

model CreateAiOutboundTaskShrinkRequest {
  concurrentRate?: int32(name='ConcurrentRate', example='10'),
  description?: string(name='Description'),
  executionTime?: string(name='ExecutionTime', description='This parameter is required.', example='{"TUESDAY":[{"start":"06:00","end":"06:05"}],"MONDAY":[{"start":"09:00","end":"18:00"},{"start":"20:30","end":"21:45"},{"start":"22:30","end":"22:50"}],"WEDNESDAY":[{"start":"09:00","end":"18:00"}],"THURSDAY":[{"start":"09:00","end":"18:00"}],"FRIDAY":[{"start":"09:00","end":"18:00"}],"SATURDAY":[{"start":"09:00","end":"18:00"}],"SUNDAY":[{"start":"17:00","end":"23:45"}]}'),
  forecastCallRate?: float(name='ForecastCallRate', example='1.5'),
  handlerId?: long(name='HandlerId', description='This parameter is required.', example='123456'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='cc_xp_pre-cn-***'),
  name?: string(name='Name', description='This parameter is required.', example='xx外呼任务'),
  numRepeated?: int32(name='NumRepeated', description='This parameter is required.', example='1'),
  outboundNumsShrink?: string(name='OutboundNums', description='This parameter is required.'),
  recallRuleShrink?: string(name='RecallRule'),
  type?: int32(name='Type', description='This parameter is required.', example='2', nullable=false),
}

model CreateAiOutboundTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: long(name='Data', example='123456'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model CreateAiOutboundTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAiOutboundTaskResponseBody(name='body'),
}

/**
 * @summary 创建智能外呼任务（预测式外呼、自动外呼）
 *
 * @param tmpReq CreateAiOutboundTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAiOutboundTaskResponse
 */
async function createAiOutboundTaskWithOptions(tmpReq: CreateAiOutboundTaskRequest, runtime: Util.RuntimeOptions): CreateAiOutboundTaskResponse {
  Util.validateModel(tmpReq);
  var request = new CreateAiOutboundTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.outboundNums)) {
    request.outboundNumsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.outboundNums, 'OutboundNums', 'json');
  }
  if (!Util.isUnset(tmpReq.recallRule)) {
    request.recallRuleShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.recallRule, 'RecallRule', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.concurrentRate)) {
    query['ConcurrentRate'] = request.concurrentRate;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.executionTime)) {
    query['ExecutionTime'] = request.executionTime;
  }
  if (!Util.isUnset(request.forecastCallRate)) {
    query['ForecastCallRate'] = request.forecastCallRate;
  }
  if (!Util.isUnset(request.handlerId)) {
    query['HandlerId'] = request.handlerId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.numRepeated)) {
    query['NumRepeated'] = request.numRepeated;
  }
  if (!Util.isUnset(request.outboundNumsShrink)) {
    query['OutboundNums'] = request.outboundNumsShrink;
  }
  if (!Util.isUnset(request.recallRuleShrink)) {
    query['RecallRule'] = request.recallRuleShrink;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAiOutboundTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建智能外呼任务（预测式外呼、自动外呼）
 *
 * @param request CreateAiOutboundTaskRequest
 * @return CreateAiOutboundTaskResponse
 */
async function createAiOutboundTask(request: CreateAiOutboundTaskRequest): CreateAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAiOutboundTaskWithOptions(request, runtime);
}

model CreateAiOutboundTaskBatchRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model CreateAiOutboundTaskBatchResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: int32(name='Data', example='123456'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model CreateAiOutboundTaskBatchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAiOutboundTaskBatchResponseBody(name='body'),
}

/**
 * @summary 创建智能外呼任务批次
 *
 * @param request CreateAiOutboundTaskBatchRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAiOutboundTaskBatchResponse
 */
async function createAiOutboundTaskBatchWithOptions(request: CreateAiOutboundTaskBatchRequest, runtime: Util.RuntimeOptions): CreateAiOutboundTaskBatchResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAiOutboundTaskBatch',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建智能外呼任务批次
 *
 * @param request CreateAiOutboundTaskBatchRequest
 * @return CreateAiOutboundTaskBatchResponse
 */
async function createAiOutboundTaskBatch(request: CreateAiOutboundTaskBatchRequest): CreateAiOutboundTaskBatchResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAiOutboundTaskBatchWithOptions(request, runtime);
}

model CreateDepartmentRequest {
  departmentName?: string(name='DepartmentName', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model CreateDepartmentResponseBody = {
  code?: string(name='Code', example='200'),
  data?: long(name='Data', example='123456'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='98B032F5-6473-4EAC-8BA8-C28993513A1F'),
  success?: boolean(name='Success', example='true'),
}

model CreateDepartmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDepartmentResponseBody(name='body'),
}

/**
 * @summary 创建部门信息
 *
 * @param request CreateDepartmentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDepartmentResponse
 */
async function createDepartmentWithOptions(request: CreateDepartmentRequest, runtime: Util.RuntimeOptions): CreateDepartmentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.departmentName)) {
    query['DepartmentName'] = request.departmentName;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDepartment',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建部门信息
 *
 * @param request CreateDepartmentRequest
 * @return CreateDepartmentResponse
 */
async function createDepartment(request: CreateDepartmentRequest): CreateDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDepartmentWithOptions(request, runtime);
}

model CreateOutboundTaskRequest {
  ani?: string(name='Ani', description='This parameter is required.'),
  callInfos?: string(name='CallInfos'),
  departmentId?: long(name='DepartmentId'),
  description?: string(name='Description'),
  endDate?: string(name='EndDate', description='This parameter is required.'),
  endTime?: string(name='EndTime', description='This parameter is required.'),
  extAttrs?: string(name='ExtAttrs'),
  groupName?: string(name='GroupName'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  model?: int32(name='Model'),
  retryInterval?: int32(name='RetryInterval'),
  retryTime?: int32(name='RetryTime'),
  skillGroup?: long(name='SkillGroup', description='This parameter is required.'),
  startDate?: string(name='StartDate', description='This parameter is required.'),
  startTime?: string(name='StartTime', description='This parameter is required.'),
  taskName?: string(name='TaskName', description='This parameter is required.'),
  taskType?: int32(name='TaskType', description='This parameter is required.'),
}

model CreateOutboundTaskResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateOutboundTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateOutboundTaskResponseBody(name='body'),
}

/**
 * @param request CreateOutboundTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateOutboundTaskResponse
 */
async function createOutboundTaskWithOptions(request: CreateOutboundTaskRequest, runtime: Util.RuntimeOptions): CreateOutboundTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ani)) {
    query['Ani'] = request.ani;
  }
  if (!Util.isUnset(request.callInfos)) {
    query['CallInfos'] = request.callInfos;
  }
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.extAttrs)) {
    query['ExtAttrs'] = request.extAttrs;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.model)) {
    query['Model'] = request.model;
  }
  if (!Util.isUnset(request.retryInterval)) {
    query['RetryInterval'] = request.retryInterval;
  }
  if (!Util.isUnset(request.retryTime)) {
    query['RetryTime'] = request.retryTime;
  }
  if (!Util.isUnset(request.skillGroup)) {
    query['SkillGroup'] = request.skillGroup;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateOutboundTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateOutboundTaskRequest
 * @return CreateOutboundTaskResponse
 */
async function createOutboundTask(request: CreateOutboundTaskRequest): CreateOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createOutboundTaskWithOptions(request, runtime);
}

model CreateQualityProjectRequest {
  analysisIds?: [ long ](name='AnalysisIds', description='This parameter is required.'),
  channelTouchType?: [ int32 ](name='ChannelTouchType'),
  checkFreqType?: int32(name='CheckFreqType', description='This parameter is required.'),
  depList?: [ long ](name='DepList'),
  groupList?: [ long ](name='GroupList'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  projectName?: string(name='ProjectName', description='This parameter is required.'),
  scopeType?: int32(name='ScopeType', description='This parameter is required.'),
  servicerList?: [ string ](name='ServicerList'),
  timeRangeEnd?: string(name='TimeRangeEnd'),
  timeRangeStart?: string(name='TimeRangeStart'),
}

model CreateQualityProjectResponseBody = {
  code?: string(name='Code'),
  data?: {
    instanceId?: string(name='InstanceId'),
    projectId?: long(name='ProjectId'),
    version?: int32(name='Version'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateQualityProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateQualityProjectResponseBody(name='body'),
}

/**
 * @param request CreateQualityProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateQualityProjectResponse
 */
async function createQualityProjectWithOptions(request: CreateQualityProjectRequest, runtime: Util.RuntimeOptions): CreateQualityProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.analysisIds)) {
    body['AnalysisIds'] = request.analysisIds;
  }
  if (!Util.isUnset(request.channelTouchType)) {
    body['ChannelTouchType'] = request.channelTouchType;
  }
  if (!Util.isUnset(request.checkFreqType)) {
    body['CheckFreqType'] = request.checkFreqType;
  }
  if (!Util.isUnset(request.depList)) {
    body['DepList'] = request.depList;
  }
  if (!Util.isUnset(request.groupList)) {
    body['GroupList'] = request.groupList;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.projectName)) {
    body['ProjectName'] = request.projectName;
  }
  if (!Util.isUnset(request.scopeType)) {
    body['ScopeType'] = request.scopeType;
  }
  if (!Util.isUnset(request.servicerList)) {
    body['ServicerList'] = request.servicerList;
  }
  if (!Util.isUnset(request.timeRangeEnd)) {
    body['TimeRangeEnd'] = request.timeRangeEnd;
  }
  if (!Util.isUnset(request.timeRangeStart)) {
    body['TimeRangeStart'] = request.timeRangeStart;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateQualityProject',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateQualityProjectRequest
 * @return CreateQualityProjectResponse
 */
async function createQualityProject(request: CreateQualityProjectRequest): CreateQualityProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return createQualityProjectWithOptions(request, runtime);
}

model CreateQualityRuleRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  keyWords?: [ string ](name='KeyWords', description='This parameter is required.'),
  matchType?: int32(name='MatchType', description='This parameter is required.'),
  name?: string(name='Name', description='This parameter is required.'),
  ruleTag?: int32(name='RuleTag', description='This parameter is required.'),
}

model CreateQualityRuleResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateQualityRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateQualityRuleResponseBody(name='body'),
}

/**
 * @param request CreateQualityRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateQualityRuleResponse
 */
async function createQualityRuleWithOptions(request: CreateQualityRuleRequest, runtime: Util.RuntimeOptions): CreateQualityRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.keyWords)) {
    body['KeyWords'] = request.keyWords;
  }
  if (!Util.isUnset(request.matchType)) {
    body['MatchType'] = request.matchType;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.ruleTag)) {
    body['RuleTag'] = request.ruleTag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateQualityRule',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateQualityRuleRequest
 * @return CreateQualityRuleResponse
 */
async function createQualityRule(request: CreateQualityRuleRequest): CreateQualityRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createQualityRuleWithOptions(request, runtime);
}

model CreateSkillGroupRequest {
  channelType?: int32(name='ChannelType', description='This parameter is required.', example='2'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-****-70b6a298d94d'),
  departmentId?: long(name='DepartmentId', example='123'),
  description?: string(name='Description'),
  displayName?: string(name='DisplayName'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  skillGroupName?: string(name='SkillGroupName', description='This parameter is required.'),
}

model CreateSkillGroupResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: long(name='Data', example='123456'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model CreateSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSkillGroupResponseBody(name='body'),
}

/**
 * @param request CreateSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSkillGroupResponse
 */
async function createSkillGroupWithOptions(request: CreateSkillGroupRequest, runtime: Util.RuntimeOptions): CreateSkillGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.channelType)) {
    body['ChannelType'] = request.channelType;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.departmentId)) {
    body['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.displayName)) {
    body['DisplayName'] = request.displayName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.skillGroupName)) {
    body['SkillGroupName'] = request.skillGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateSkillGroup',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateSkillGroupRequest
 * @return CreateSkillGroupResponse
 */
async function createSkillGroup(request: CreateSkillGroupRequest): CreateSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSkillGroupWithOptions(request, runtime);
}

model CreateTaskRequest {
  callString?: string(name='CallString'),
  callStringType?: string(name='CallStringType', description='This parameter is required.', example='JSON'),
  caller?: string(name='Caller', description='This parameter is required.', example='0571****5678,0571****5679'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  retryCount?: int32(name='RetryCount', example='2'),
  retryFlag?: int32(name='RetryFlag', example='1'),
  retryInterval?: int32(name='RetryInterval', example='2'),
  retryStatusCode?: string(name='RetryStatusCode', example='200010,200011'),
  robotId?: string(name='RobotId', description='This parameter is required.', example='123456'),
  seatCount?: string(name='SeatCount', description='This parameter is required.', example='3'),
  startNow?: boolean(name='StartNow'),
  taskName?: string(name='TaskName', description='This parameter is required.'),
  workDay?: string(name='WorkDay', description='This parameter is required.', example='1'),
  workTimeList?: string(name='WorkTimeList', description='This parameter is required.', example='10:00-12:00,13:00-14:00'),
}

model CreateTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: long(name='Data', example='123456'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model CreateTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTaskResponseBody(name='body'),
}

/**
 * @summary 创建外呼任务
 *
 * @param request CreateTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTaskResponse
 */
async function createTaskWithOptions(request: CreateTaskRequest, runtime: Util.RuntimeOptions): CreateTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callString)) {
    query['CallString'] = request.callString;
  }
  if (!Util.isUnset(request.callStringType)) {
    query['CallStringType'] = request.callStringType;
  }
  if (!Util.isUnset(request.caller)) {
    query['Caller'] = request.caller;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.retryCount)) {
    query['RetryCount'] = request.retryCount;
  }
  if (!Util.isUnset(request.retryFlag)) {
    query['RetryFlag'] = request.retryFlag;
  }
  if (!Util.isUnset(request.retryInterval)) {
    query['RetryInterval'] = request.retryInterval;
  }
  if (!Util.isUnset(request.retryStatusCode)) {
    query['RetryStatusCode'] = request.retryStatusCode;
  }
  if (!Util.isUnset(request.robotId)) {
    query['RobotId'] = request.robotId;
  }
  if (!Util.isUnset(request.seatCount)) {
    query['SeatCount'] = request.seatCount;
  }
  if (!Util.isUnset(request.startNow)) {
    query['StartNow'] = request.startNow;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.workDay)) {
    query['WorkDay'] = request.workDay;
  }
  if (!Util.isUnset(request.workTimeList)) {
    query['WorkTimeList'] = request.workTimeList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建外呼任务
 *
 * @param request CreateTaskRequest
 * @return CreateTaskResponse
 */
async function createTask(request: CreateTaskRequest): CreateTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTaskWithOptions(request, runtime);
}

model CreateThirdSsoAgentRequest {
  accountId?: string(name='AccountId', description='This parameter is required.', example='accountId1'),
  accountName?: string(name='AccountName', description='This parameter is required.', example='accountName1'),
  clientId?: string(name='ClientId', description='This parameter is required.', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  displayName?: string(name='DisplayName'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre***'),
  roleIds?: [ long ](name='RoleIds'),
  skillGroupIds?: [ long ](name='SkillGroupIds'),
}

model CreateThirdSsoAgentResponseBody = {
  code?: string(name='Code', example='200'),
  data?: long(name='Data', example='123456'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Success'),
  requestId?: string(name='RequestId', description='requestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model CreateThirdSsoAgentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateThirdSsoAgentResponseBody(name='body'),
}

/**
 * @summary 创建坐席并开通sso登录能力
 *
 * @param request CreateThirdSsoAgentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateThirdSsoAgentResponse
 */
async function createThirdSsoAgentWithOptions(request: CreateThirdSsoAgentRequest, runtime: Util.RuntimeOptions): CreateThirdSsoAgentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountId)) {
    body['AccountId'] = request.accountId;
  }
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.clientId)) {
    body['ClientId'] = request.clientId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.displayName)) {
    body['DisplayName'] = request.displayName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.roleIds)) {
    bodyFlat['RoleIds'] = request.roleIds;
  }
  if (!Util.isUnset(request.skillGroupIds)) {
    bodyFlat['SkillGroupIds'] = request.skillGroupIds;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateThirdSsoAgent',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建坐席并开通sso登录能力
 *
 * @param request CreateThirdSsoAgentRequest
 * @return CreateThirdSsoAgentResponse
 */
async function createThirdSsoAgent(request: CreateThirdSsoAgentRequest): CreateThirdSsoAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return createThirdSsoAgentWithOptions(request, runtime);
}

model DeleteAgentRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@****.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model DeleteAgentResponseBody = {
  code?: string(name='Code', example='Success'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model DeleteAgentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAgentResponseBody(name='body'),
}

/**
 * @summary 删除坐席账号
 *
 * @param request DeleteAgentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAgentResponse
 */
async function deleteAgentWithOptions(request: DeleteAgentRequest, runtime: Util.RuntimeOptions): DeleteAgentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAgent',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'DELETE',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除坐席账号
 *
 * @param request DeleteAgentRequest
 * @return DeleteAgentResponse
 */
async function deleteAgent(request: DeleteAgentRequest): DeleteAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAgentWithOptions(request, runtime);
}

model DeleteAiOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model DeleteAiOutboundTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model DeleteAiOutboundTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAiOutboundTaskResponseBody(name='body'),
}

/**
 * @summary 删除智能外呼任务
 *
 * @param request DeleteAiOutboundTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAiOutboundTaskResponse
 */
async function deleteAiOutboundTaskWithOptions(request: DeleteAiOutboundTaskRequest, runtime: Util.RuntimeOptions): DeleteAiOutboundTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAiOutboundTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除智能外呼任务
 *
 * @param request DeleteAiOutboundTaskRequest
 * @return DeleteAiOutboundTaskResponse
 */
async function deleteAiOutboundTask(request: DeleteAiOutboundTaskRequest): DeleteAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAiOutboundTaskWithOptions(request, runtime);
}

model DeleteDepartmentRequest {
  departmentId?: long(name='DepartmentId', description='This parameter is required.', example='123456'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model DeleteDepartmentResponseBody = {
  code?: string(name='Code', example='200'),
  data?: boolean(name='Data', example='true'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='seccessful'),
  requestId?: string(name='RequestId', example='98B032F5-6473-4EAC-8BA8-C28993513A1F'),
  success?: boolean(name='Success', example='true'),
}

model DeleteDepartmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDepartmentResponseBody(name='body'),
}

/**
 * @summary 删除部门信息
 *
 * @param request DeleteDepartmentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDepartmentResponse
 */
async function deleteDepartmentWithOptions(request: DeleteDepartmentRequest, runtime: Util.RuntimeOptions): DeleteDepartmentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDepartment',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除部门信息
 *
 * @param request DeleteDepartmentRequest
 * @return DeleteDepartmentResponse
 */
async function deleteDepartment(request: DeleteDepartmentRequest): DeleteDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDepartmentWithOptions(request, runtime);
}

model DeleteHotlineNumberRequest {
  hotlineNumber?: string(name='HotlineNumber', description='This parameter is required.', example='05710000****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model DeleteHotlineNumberResponseBody = {
  code?: string(name='Code', example='Success'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='98B032F5-6473-4EAC-8BA8-C28993513A1F'),
  success?: boolean(name='Success', example='true'),
}

model DeleteHotlineNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHotlineNumberResponseBody(name='body'),
}

/**
 * @summary 删除热线号码
 *
 * @param request DeleteHotlineNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHotlineNumberResponse
 */
async function deleteHotlineNumberWithOptions(request: DeleteHotlineNumberRequest, runtime: Util.RuntimeOptions): DeleteHotlineNumberResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.hotlineNumber)) {
    body['HotlineNumber'] = request.hotlineNumber;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteHotlineNumber',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除热线号码
 *
 * @param request DeleteHotlineNumberRequest
 * @return DeleteHotlineNumberResponse
 */
async function deleteHotlineNumber(request: DeleteHotlineNumberRequest): DeleteHotlineNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteHotlineNumberWithOptions(request, runtime);
}

model DeleteOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  outboundTaskId?: long(name='OutboundTaskId', description='This parameter is required.'),
}

model DeleteOutboundTaskResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteOutboundTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteOutboundTaskResponseBody(name='body'),
}

/**
 * @param request DeleteOutboundTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteOutboundTaskResponse
 */
async function deleteOutboundTaskWithOptions(request: DeleteOutboundTaskRequest, runtime: Util.RuntimeOptions): DeleteOutboundTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.outboundTaskId)) {
    query['OutboundTaskId'] = request.outboundTaskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteOutboundTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DeleteOutboundTaskRequest
 * @return DeleteOutboundTaskResponse
 */
async function deleteOutboundTask(request: DeleteOutboundTaskRequest): DeleteOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteOutboundTaskWithOptions(request, runtime);
}

model DeleteOuterAccountRequest {
  outerAccountId?: string(name='OuterAccountId', description='This parameter is required.', example='123456'),
  outerAccountType?: string(name='OuterAccountType', description='This parameter is required.', example='aliyun'),
}

model DeleteOuterAccountResponseBody = {
  code?: string(name='Code', example='200'),
  data?: boolean(name='Data', example='true'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model DeleteOuterAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteOuterAccountResponseBody(name='body'),
}

/**
 * @param request DeleteOuterAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteOuterAccountResponse
 */
async function deleteOuterAccountWithOptions(request: DeleteOuterAccountRequest, runtime: Util.RuntimeOptions): DeleteOuterAccountResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteOuterAccount',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DeleteOuterAccountRequest
 * @return DeleteOuterAccountResponse
 */
async function deleteOuterAccount(request: DeleteOuterAccountRequest): DeleteOuterAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteOuterAccountWithOptions(request, runtime);
}

model DeleteQualityProjectRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  projectId?: long(name='ProjectId'),
}

model DeleteQualityProjectResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteQualityProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteQualityProjectResponseBody(name='body'),
}

/**
 * @param request DeleteQualityProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteQualityProjectResponse
 */
async function deleteQualityProjectWithOptions(request: DeleteQualityProjectRequest, runtime: Util.RuntimeOptions): DeleteQualityProjectResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteQualityProject',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DeleteQualityProjectRequest
 * @return DeleteQualityProjectResponse
 */
async function deleteQualityProject(request: DeleteQualityProjectRequest): DeleteQualityProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteQualityProjectWithOptions(request, runtime);
}

model DeleteQualityRuleRequest {
  id?: long(name='Id', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model DeleteQualityRuleResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteQualityRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteQualityRuleResponseBody(name='body'),
}

/**
 * @param request DeleteQualityRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteQualityRuleResponse
 */
async function deleteQualityRuleWithOptions(request: DeleteQualityRuleRequest, runtime: Util.RuntimeOptions): DeleteQualityRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteQualityRule',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DeleteQualityRuleRequest
 * @return DeleteQualityRuleResponse
 */
async function deleteQualityRule(request: DeleteQualityRuleRequest): DeleteQualityRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteQualityRuleWithOptions(request, runtime);
}

model DeleteSkillGroupRequest {
  outerGroupId?: string(name='OuterGroupId', example='123456'),
  outerGroupType?: string(name='OuterGroupType', example='2'),
}

model DeleteSkillGroupResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: boolean(name='Data', example='true'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model DeleteSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSkillGroupResponseBody(name='body'),
}

/**
 * @param request DeleteSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSkillGroupResponse
 */
async function deleteSkillGroupWithOptions(request: DeleteSkillGroupRequest, runtime: Util.RuntimeOptions): DeleteSkillGroupResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSkillGroup',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DeleteSkillGroupRequest
 * @return DeleteSkillGroupResponse
 */
async function deleteSkillGroup(request: DeleteSkillGroupRequest): DeleteSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSkillGroupWithOptions(request, runtime);
}

model DescribeRecordDataRequest {
  accountId?: string(name='AccountId', example='2235****'),
  accountType?: string(name='AccountType', example='BUC_TYPE'),
  acid?: string(name='Acid', example='1004849****'),
  ownerId?: long(name='OwnerId'),
  prodCode?: string(name='ProdCode', example='aiccs'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  secLevel?: int32(name='SecLevel', example='2'),
}

model DescribeRecordDataResponseBody = {
  acid?: string(name='Acid', example='1004849****'),
  agentId?: string(name='AgentId', example='1212****'),
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='OK'),
  ossLink?: string(name='OssLink', example='https://****'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
}

model DescribeRecordDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRecordDataResponseBody(name='body'),
}

/**
 * @param request DescribeRecordDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRecordDataResponse
 */
async function describeRecordDataWithOptions(request: DescribeRecordDataRequest, runtime: Util.RuntimeOptions): DescribeRecordDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountId)) {
    query['AccountId'] = request.accountId;
  }
  if (!Util.isUnset(request.accountType)) {
    query['AccountType'] = request.accountType;
  }
  if (!Util.isUnset(request.acid)) {
    query['Acid'] = request.acid;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.prodCode)) {
    query['ProdCode'] = request.prodCode;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.secLevel)) {
    query['SecLevel'] = request.secLevel;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRecordData',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeRecordDataRequest
 * @return DescribeRecordDataResponse
 */
async function describeRecordData(request: DescribeRecordDataRequest): DescribeRecordDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRecordDataWithOptions(request, runtime);
}

model EditQualityProjectRequest {
  analysisIds?: [ long ](name='AnalysisIds', description='This parameter is required.'),
  channelTouchType?: [ int32 ](name='ChannelTouchType', description='This parameter is required.'),
  checkFreqType?: int32(name='CheckFreqType', description='This parameter is required.'),
  depList?: [ long ](name='DepList'),
  groupList?: [ long ](name='GroupList'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  projectId?: long(name='ProjectId', description='This parameter is required.'),
  projectName?: string(name='ProjectName', description='This parameter is required.'),
  projectVersion?: int32(name='ProjectVersion', description='This parameter is required.'),
  scopeType?: int32(name='ScopeType', description='This parameter is required.'),
  servicerList?: [ string ](name='ServicerList'),
  timeRangeEnd?: string(name='TimeRangeEnd'),
  timeRangeStart?: string(name='TimeRangeStart'),
}

model EditQualityProjectResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      instanceId?: string(name='InstanceId'),
      projectId?: long(name='ProjectId'),
      version?: int32(name='Version'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EditQualityProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EditQualityProjectResponseBody(name='body'),
}

/**
 * @param request EditQualityProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EditQualityProjectResponse
 */
async function editQualityProjectWithOptions(request: EditQualityProjectRequest, runtime: Util.RuntimeOptions): EditQualityProjectResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.analysisIds)) {
    query['AnalysisIds'] = request.analysisIds;
  }
  if (!Util.isUnset(request.channelTouchType)) {
    query['ChannelTouchType'] = request.channelTouchType;
  }
  if (!Util.isUnset(request.checkFreqType)) {
    query['CheckFreqType'] = request.checkFreqType;
  }
  if (!Util.isUnset(request.depList)) {
    query['DepList'] = request.depList;
  }
  if (!Util.isUnset(request.groupList)) {
    query['GroupList'] = request.groupList;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.projectVersion)) {
    query['ProjectVersion'] = request.projectVersion;
  }
  if (!Util.isUnset(request.scopeType)) {
    query['ScopeType'] = request.scopeType;
  }
  if (!Util.isUnset(request.servicerList)) {
    query['ServicerList'] = request.servicerList;
  }
  if (!Util.isUnset(request.timeRangeEnd)) {
    query['TimeRangeEnd'] = request.timeRangeEnd;
  }
  if (!Util.isUnset(request.timeRangeStart)) {
    query['TimeRangeStart'] = request.timeRangeStart;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.projectName)) {
    body['ProjectName'] = request.projectName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EditQualityProject',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request EditQualityProjectRequest
 * @return EditQualityProjectResponse
 */
async function editQualityProject(request: EditQualityProjectRequest): EditQualityProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return editQualityProjectWithOptions(request, runtime);
}

model EditQualityRuleRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  keyWords?: [ string ](name='KeyWords', description='This parameter is required.'),
  matchType?: int32(name='MatchType', description='This parameter is required.'),
  name?: string(name='Name', description='This parameter is required.'),
  qualityRuleId?: long(name='QualityRuleId', description='This parameter is required.'),
  ruleTag?: int32(name='RuleTag', description='This parameter is required.'),
}

model EditQualityRuleResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EditQualityRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EditQualityRuleResponseBody(name='body'),
}

/**
 * @param request EditQualityRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EditQualityRuleResponse
 */
async function editQualityRuleWithOptions(request: EditQualityRuleRequest, runtime: Util.RuntimeOptions): EditQualityRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.keyWords)) {
    body['KeyWords'] = request.keyWords;
  }
  if (!Util.isUnset(request.matchType)) {
    body['MatchType'] = request.matchType;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.qualityRuleId)) {
    body['QualityRuleId'] = request.qualityRuleId;
  }
  if (!Util.isUnset(request.ruleTag)) {
    body['RuleTag'] = request.ruleTag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EditQualityRule',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request EditQualityRuleRequest
 * @return EditQualityRuleResponse
 */
async function editQualityRule(request: EditQualityRuleRequest): EditQualityRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return editQualityRuleWithOptions(request, runtime);
}

model EditQualityRuleTagRequest {
  analysisTypes?: [ 
    {
      id?: long(name='Id'),
      name?: string(name='Name'),
    }
  ](name='AnalysisTypes', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model EditQualityRuleTagResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EditQualityRuleTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EditQualityRuleTagResponseBody(name='body'),
}

/**
 * @param request EditQualityRuleTagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EditQualityRuleTagResponse
 */
async function editQualityRuleTagWithOptions(request: EditQualityRuleTagRequest, runtime: Util.RuntimeOptions): EditQualityRuleTagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.analysisTypes)) {
    query['AnalysisTypes'] = request.analysisTypes;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EditQualityRuleTag',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request EditQualityRuleTagRequest
 * @return EditQualityRuleTagResponse
 */
async function editQualityRuleTag(request: EditQualityRuleTagRequest): EditQualityRuleTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return editQualityRuleTagWithOptions(request, runtime);
}

model EncryptPhoneNumRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre***'),
  phoneNum?: string(name='PhoneNum', description='This parameter is required.', example='130****0000'),
}

model EncryptPhoneNumResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model EncryptPhoneNumResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EncryptPhoneNumResponseBody(name='body'),
}

/**
 * @summary 热线号码加密
 *
 * @param request EncryptPhoneNumRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EncryptPhoneNumResponse
 */
async function encryptPhoneNumWithOptions(request: EncryptPhoneNumRequest, runtime: Util.RuntimeOptions): EncryptPhoneNumResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EncryptPhoneNum',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 热线号码加密
 *
 * @param request EncryptPhoneNumRequest
 * @return EncryptPhoneNumResponse
 */
async function encryptPhoneNum(request: EncryptPhoneNumRequest): EncryptPhoneNumResponse {
  var runtime = new Util.RuntimeOptions{};
  return encryptPhoneNumWithOptions(request, runtime);
}

model FetchCallRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  callId?: string(name='CallId', example='7719786'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  connectionId?: string(name='ConnectionId', example='7719788'),
  holdConnectionId?: string(name='HoldConnectionId', example='0'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  jobId?: string(name='JobId', example='7719787'),
}

model FetchCallResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model FetchCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FetchCallResponseBody(name='body'),
}

/**
 * @param request FetchCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FetchCallResponse
 */
async function fetchCallWithOptions(request: FetchCallRequest, runtime: Util.RuntimeOptions): FetchCallResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.callId)) {
    body['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionId)) {
    body['ConnectionId'] = request.connectionId;
  }
  if (!Util.isUnset(request.holdConnectionId)) {
    body['HoldConnectionId'] = request.holdConnectionId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'FetchCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request FetchCallRequest
 * @return FetchCallResponse
 */
async function fetchCall(request: FetchCallRequest): FetchCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return fetchCallWithOptions(request, runtime);
}

model FinishHotlineServiceRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@****.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model FinishHotlineServiceResponseBody = {
  code?: string(name='Code', example='Success'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model FinishHotlineServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FinishHotlineServiceResponseBody(name='body'),
}

/**
 * @param request FinishHotlineServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FinishHotlineServiceResponse
 */
async function finishHotlineServiceWithOptions(request: FinishHotlineServiceRequest, runtime: Util.RuntimeOptions): FinishHotlineServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'FinishHotlineService',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request FinishHotlineServiceRequest
 * @return FinishHotlineServiceResponse
 */
async function finishHotlineService(request: FinishHotlineServiceRequest): FinishHotlineServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return finishHotlineServiceWithOptions(request, runtime);
}

model GenerateWebSocketSignRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GenerateWebSocketSignResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: string(name='Data', example='dnthF_oinHg7JMJDmKqex3UxDD7'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GenerateWebSocketSignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateWebSocketSignResponseBody(name='body'),
}

/**
 * @param request GenerateWebSocketSignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateWebSocketSignResponse
 */
async function generateWebSocketSignWithOptions(request: GenerateWebSocketSignRequest, runtime: Util.RuntimeOptions): GenerateWebSocketSignResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateWebSocketSign',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GenerateWebSocketSignRequest
 * @return GenerateWebSocketSignResponse
 */
async function generateWebSocketSign(request: GenerateWebSocketSignRequest): GenerateWebSocketSignResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateWebSocketSignWithOptions(request, runtime);
}

model GetAgentRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GetAgentResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: {
    accountName?: string(name='AccountName', example='123@123.com'),
    agentId?: long(name='AgentId', example='222222'),
    displayName?: string(name='DisplayName'),
    groupList?: [ 
      {
        channelType?: int32(name='ChannelType', example='1'),
        description?: string(name='Description'),
        displayName?: string(name='DisplayName'),
        name?: string(name='Name'),
        skillGroupId?: long(name='SkillGroupId', example='123456'),
      }
    ](name='GroupList'),
    status?: int32(name='Status', example='0'),
    tenantId?: long(name='TenantId', example='0'),
  }(name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetAgentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAgentResponseBody(name='body'),
}

/**
 * @param request GetAgentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAgentResponse
 */
async function getAgentWithOptions(request: GetAgentRequest, runtime: Util.RuntimeOptions): GetAgentResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAgent',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetAgentRequest
 * @return GetAgentResponse
 */
async function getAgent(request: GetAgentRequest): GetAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentWithOptions(request, runtime);
}

model GetAgentBasisStatusRequest {
  agentIds?: [ long ](name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetAgentBasisStatusShrinkRequest {
  agentIdsShrink?: string(name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetAgentBasisStatusResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rows?: string(name='Rows'),
    totalNum?: int32(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetAgentBasisStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAgentBasisStatusResponseBody(name='body'),
}

/**
 * @summary 坐席纬度基础状态量
 *
 * @param tmpReq GetAgentBasisStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAgentBasisStatusResponse
 */
async function getAgentBasisStatusWithOptions(tmpReq: GetAgentBasisStatusRequest, runtime: Util.RuntimeOptions): GetAgentBasisStatusResponse {
  Util.validateModel(tmpReq);
  var request = new GetAgentBasisStatusShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAgentBasisStatus',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 坐席纬度基础状态量
 *
 * @param request GetAgentBasisStatusRequest
 * @return GetAgentBasisStatusResponse
 */
async function getAgentBasisStatus(request: GetAgentBasisStatusRequest): GetAgentBasisStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentBasisStatusWithOptions(request, runtime);
}

model GetAgentByIdRequest {
  agentId?: long(name='AgentId', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model GetAgentByIdResponseBody = {
  code?: string(name='Code'),
  data?: {
    agentId?: int32(name='AgentId'),
    createUserName?: string(name='CreateUserName'),
    foreignKey?: string(name='ForeignKey'),
    foreignNick?: string(name='ForeignNick'),
    realName?: string(name='RealName'),
    servicerType?: int32(name='ServicerType'),
    showName?: string(name='ShowName'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetAgentByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAgentByIdResponseBody(name='body'),
}

/**
 * @param request GetAgentByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAgentByIdResponse
 */
async function getAgentByIdWithOptions(request: GetAgentByIdRequest, runtime: Util.RuntimeOptions): GetAgentByIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.agentId)) {
    body['AgentId'] = request.agentId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetAgentById',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetAgentByIdRequest
 * @return GetAgentByIdResponse
 */
async function getAgentById(request: GetAgentByIdRequest): GetAgentByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentByIdWithOptions(request, runtime);
}

model GetAgentDetailReportRequest {
  agentIds?: [ long ](name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='true/false'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true/false'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='day'),
}

model GetAgentDetailReportShrinkRequest {
  agentIdsShrink?: string(name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='true/false'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true/false'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='day'),
}

model GetAgentDetailReportResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='2000'),
    rows?: string(name='Rows', example='{"t_wait":379322.0,"hotline_time_outcall_avg":"32.00","n_ringing":0,"t_outbound_40":0.0,"hotline_time_incall_avg":-1,"t_calldialing":0.0,"n_inbound":276,"servicer_id":"-1","call_in_sep_sat_cnt":13,"request_cnt":231,"n_not_ready_99":811,"t_work_outbound":49338.0,"hotline_rate_handle_in_60s":"96%","n_not_ready_login":811,"t_not_ready_login":0.0,"n_work_inbound":176,"}'),
    totalNum?: long(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetAgentDetailReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAgentDetailReportResponseBody(name='body'),
}

/**
 * @summary 热线坐席纬度详情汇总
 *
 * @param tmpReq GetAgentDetailReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAgentDetailReportResponse
 */
async function getAgentDetailReportWithOptions(tmpReq: GetAgentDetailReportRequest, runtime: Util.RuntimeOptions): GetAgentDetailReportResponse {
  Util.validateModel(tmpReq);
  var request = new GetAgentDetailReportShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAgentDetailReport',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 热线坐席纬度详情汇总
 *
 * @param request GetAgentDetailReportRequest
 * @return GetAgentDetailReportResponse
 */
async function getAgentDetailReport(request: GetAgentDetailReportRequest): GetAgentDetailReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentDetailReportWithOptions(request, runtime);
}

model GetAgentIndexRealTimeRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
}

model GetAgentIndexRealTimeResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    columns?: [ 
      {
        key?: string(name='Key'),
        title?: string(name='Title', example='servicerId'),
      }
    ](name='Columns'),
    page?: int32(name='Page', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    rows?: [  map[string]any ](name='Rows'),
    total?: int32(name='Total', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetAgentIndexRealTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAgentIndexRealTimeResponseBody(name='body'),
}

/**
 * @param request GetAgentIndexRealTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAgentIndexRealTimeResponse
 */
async function getAgentIndexRealTimeWithOptions(request: GetAgentIndexRealTimeRequest, runtime: Util.RuntimeOptions): GetAgentIndexRealTimeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.depIds)) {
    query['DepIds'] = request.depIds;
  }
  if (!Util.isUnset(request.groupIds)) {
    query['GroupIds'] = request.groupIds;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAgentIndexRealTime',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetAgentIndexRealTimeRequest
 * @return GetAgentIndexRealTimeResponse
 */
async function getAgentIndexRealTime(request: GetAgentIndexRealTimeRequest): GetAgentIndexRealTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentIndexRealTimeWithOptions(request, runtime);
}

model GetAgentServiceStatusRequest {
  agentIds?: [ long ](name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='true'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetAgentServiceStatusShrinkRequest {
  agentIdsShrink?: string(name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='true'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetAgentServiceStatusResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='2000'),
    rows?: string(name='Rows', example='{"online_40s_transfer_ready_cnt":81,"minute_id":"-1","online_unsatis_cnt":0,"online_simple_cnt":0,"average_queue_time":-1,"service_pickup":"2086","total_waiting_time":"981","online_service_time_len":58208,"online_direct_give_up_len":0,"break_ratio":"2%"}'),
    totalNum?: long(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetAgentServiceStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAgentServiceStatusResponseBody(name='body'),
}

/**
 * @summary 坐席服务状态量
 *
 * @param tmpReq GetAgentServiceStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAgentServiceStatusResponse
 */
async function getAgentServiceStatusWithOptions(tmpReq: GetAgentServiceStatusRequest, runtime: Util.RuntimeOptions): GetAgentServiceStatusResponse {
  Util.validateModel(tmpReq);
  var request = new GetAgentServiceStatusShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAgentServiceStatus',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 坐席服务状态量
 *
 * @param request GetAgentServiceStatusRequest
 * @return GetAgentServiceStatusResponse
 */
async function getAgentServiceStatus(request: GetAgentServiceStatusRequest): GetAgentServiceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentServiceStatusWithOptions(request, runtime);
}

model GetAgentStatisticsRequest {
  agentIds?: [ long ](name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='false'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='false'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetAgentStatisticsShrinkRequest {
  agentIdsShrink?: string(name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='false'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='false'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetAgentStatisticsResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rows?: string(name='Rows', example='{"n_resttype_1":15,"t_outcall_speak":829747,"average_incoming_time":"8451.29","n_resttype_3":0,"minute_id":"-1","n_conference_speak":0,"n_resttype_2":0,"n_resttype_5":0,"n_resttype_4":0,"n_resttype_7":0,"n_resttype_6":0,"n_resttype_9":0,"n_resttype_8":0,"n_outcall_dial":25,"total_break_time":"58555","n_internal_speak":0,"n_send_step_transfer":7,"n_consulted_internal_speak":0}'),
    totalNum?: int32(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetAgentStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAgentStatisticsResponseBody(name='body'),
}

/**
 * @summary 坐席纬度统计量
 *
 * @param tmpReq GetAgentStatisticsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAgentStatisticsResponse
 */
async function getAgentStatisticsWithOptions(tmpReq: GetAgentStatisticsRequest, runtime: Util.RuntimeOptions): GetAgentStatisticsResponse {
  Util.validateModel(tmpReq);
  var request = new GetAgentStatisticsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAgentStatistics',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 坐席纬度统计量
 *
 * @param request GetAgentStatisticsRequest
 * @return GetAgentStatisticsResponse
 */
async function getAgentStatistics(request: GetAgentStatisticsRequest): GetAgentStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentStatisticsWithOptions(request, runtime);
}

model GetAiOutboundTaskBizDataRequest {
  channelId?: string(name='ChannelId', description='This parameter is required.', example='123456'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
}

model GetAiOutboundTaskBizDataResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    bizData?: string(name='BizData', example='{"customer":123}'),
    caseId?: long(name='CaseId', example='123'),
    phoneNum?: string(name='PhoneNum', example='158****0000'),
    taskId?: long(name='TaskId', example='123456'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetAiOutboundTaskBizDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAiOutboundTaskBizDataResponseBody(name='body'),
}

/**
 * @summary 获取智能外呼任务业务自定义信息
 *
 * @param request GetAiOutboundTaskBizDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAiOutboundTaskBizDataResponse
 */
async function getAiOutboundTaskBizDataWithOptions(request: GetAiOutboundTaskBizDataRequest, runtime: Util.RuntimeOptions): GetAiOutboundTaskBizDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAiOutboundTaskBizData',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取智能外呼任务业务自定义信息
 *
 * @param request GetAiOutboundTaskBizDataRequest
 * @return GetAiOutboundTaskBizDataResponse
 */
async function getAiOutboundTaskBizData(request: GetAiOutboundTaskBizDataRequest): GetAiOutboundTaskBizDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiOutboundTaskBizDataWithOptions(request, runtime);
}

model GetAiOutboundTaskDetailRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model GetAiOutboundTaskDetailResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    concurrentRate?: int32(name='ConcurrentRate', example='10'),
    description?: string(name='Description'),
    executionTime?: string(name='ExecutionTime', example='{"TUESDAY":[{"start":"06:00","end":"06:05"}],"MONDAY":[{"start":"09:00","end":"18:00"},{"start":"20:30","end":"21:45"},{"start":"22:30","end":"22:50"}],"WEDNESDAY":[{"start":"09:00","end":"18:00"}],"THURSDAY":[{"start":"09:00","end":"18:00"}],"FRIDAY":[{"start":"09:00","end":"18:00"}],"SATURDAY":[{"start":"09:00","end":"18:00"}],"SUNDAY":[{"start":"17:00","end":"23:45"}]}'),
    forecastCallRate?: float(name='ForecastCallRate', example='1.2'),
    handlerId?: long(name='HandlerId', example='123456'),
    handlerName?: string(name='HandlerName', example='热线技能组'),
    name?: string(name='Name', example='xx外呼任务'),
    numRepeated?: int32(name='NumRepeated', example='0'),
    outboundNums?: [ string ](name='OutboundNums'),
    recallRule?: {
      count?: int32(name='Count', example='2'),
      interval?: int32(name='Interval', example='2'),
    }(name='RecallRule'),
    status?: int32(name='Status', example='1'),
    statusDesc?: string(name='StatusDesc', example='未开始'),
    taskId?: long(name='TaskId', example='123'),
    type?: int32(name='Type', example='2'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model GetAiOutboundTaskDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAiOutboundTaskDetailResponseBody(name='body'),
}

/**
 * @summary 智能外呼任务配置详情查询
 *
 * @param request GetAiOutboundTaskDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAiOutboundTaskDetailResponse
 */
async function getAiOutboundTaskDetailWithOptions(request: GetAiOutboundTaskDetailRequest, runtime: Util.RuntimeOptions): GetAiOutboundTaskDetailResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAiOutboundTaskDetail',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 智能外呼任务配置详情查询
 *
 * @param request GetAiOutboundTaskDetailRequest
 * @return GetAiOutboundTaskDetailResponse
 */
async function getAiOutboundTaskDetail(request: GetAiOutboundTaskDetailRequest): GetAiOutboundTaskDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiOutboundTaskDetailWithOptions(request, runtime);
}

model GetAiOutboundTaskExecDetailRequest {
  batchVersion?: int32(name='BatchVersion', example='1'),
  caseId?: long(name='CaseId', example='123456'),
  caseStatus?: int32(name='CaseStatus', example='1'),
  createTimeEnd?: long(name='CreateTimeEnd', example='1632290119000'),
  createTimeStart?: long(name='CreateTimeStart', example='1632289999000'),
  currentPage?: int32(name='CurrentPage', description='This parameter is required.', example='1'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  phoneNum?: string(name='PhoneNum', example='150****000'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model GetAiOutboundTaskExecDetailResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    currentPage?: int32(name='CurrentPage', example='1'),
    hasNextPage?: boolean(name='HasNextPage', example='true'),
    list?: [ 
      {
        batchVersion?: int32(name='BatchVersion', example='1'),
        bizData?: string(name='BizData', example='123'),
        callCount?: int32(name='CallCount', example='1'),
        caseId?: long(name='CaseId', example='123456'),
        createTime?: long(name='CreateTime', example='1632289999000'),
        lastCallResult?: string(name='LastCallResult', example='未接通'),
        phoneNum?: string(name='PhoneNum', example='150****0000'),
        status?: int32(name='Status', example='1'),
        statusDesc?: int32(name='StatusDesc', example='待呼叫'),
      }
    ](name='List'),
    pageSize?: int32(name='PageSize', example='10'),
    totalResults?: int32(name='TotalResults', example='199'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model GetAiOutboundTaskExecDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAiOutboundTaskExecDetailResponseBody(name='body'),
}

/**
 * @summary 智能外呼任务执行详情
 *
 * @param request GetAiOutboundTaskExecDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAiOutboundTaskExecDetailResponse
 */
async function getAiOutboundTaskExecDetailWithOptions(request: GetAiOutboundTaskExecDetailRequest, runtime: Util.RuntimeOptions): GetAiOutboundTaskExecDetailResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAiOutboundTaskExecDetail',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 智能外呼任务执行详情
 *
 * @param request GetAiOutboundTaskExecDetailRequest
 * @return GetAiOutboundTaskExecDetailResponse
 */
async function getAiOutboundTaskExecDetail(request: GetAiOutboundTaskExecDetailRequest): GetAiOutboundTaskExecDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiOutboundTaskExecDetailWithOptions(request, runtime);
}

model GetAiOutboundTaskListRequest {
  createTimeEnd?: long(name='CreateTimeEnd', example='1617761765000'),
  createTimeStart?: long(name='CreateTimeStart', example='1615083365000'),
  currentPage?: int32(name='CurrentPage', description='This parameter is required.', example='1'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_****'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  searchKey?: string(name='SearchKey', example='1763****'),
  status?: int32(name='Status', example='1'),
  type?: int32(name='Type', description='This parameter is required.', example='2'),
}

model GetAiOutboundTaskListResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    currentPage?: int32(name='CurrentPage', example='1'),
    hasNextPage?: boolean(name='HasNextPage', example='false'),
    list?: [ 
      {
        concurrentRate?: int32(name='ConcurrentRate', example='1'),
        createTime?: long(name='CreateTime', example='1615083365000'),
        description?: string(name='Description'),
        finishCount?: int32(name='FinishCount', example='70'),
        finishRate?: float(name='FinishRate', example='0.7'),
        handlerId?: long(name='HandlerId', example='2468****'),
        handlerName?: string(name='HandlerName', example='热线技能组'),
        name?: string(name='Name', example='xx外呼任务'),
        status?: int32(name='Status', example='0'),
        statusDesc?: string(name='StatusDesc', example='未开始'),
        taskId?: long(name='TaskId', example='1763****'),
        totalCount?: int32(name='TotalCount', example='100'),
      }
    ](name='List'),
    pageSize?: int32(name='PageSize', example='10'),
    totalResults?: int32(name='TotalResults', example='10'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetAiOutboundTaskListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAiOutboundTaskListResponseBody(name='body'),
}

/**
 * @summary 智能外呼任务列表查询
 *
 * @param request GetAiOutboundTaskListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAiOutboundTaskListResponse
 */
async function getAiOutboundTaskListWithOptions(request: GetAiOutboundTaskListRequest, runtime: Util.RuntimeOptions): GetAiOutboundTaskListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAiOutboundTaskList',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 智能外呼任务列表查询
 *
 * @param request GetAiOutboundTaskListRequest
 * @return GetAiOutboundTaskListResponse
 */
async function getAiOutboundTaskList(request: GetAiOutboundTaskListRequest): GetAiOutboundTaskListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiOutboundTaskListWithOptions(request, runtime);
}

model GetAiOutboundTaskProgressRequest {
  batchVersion?: int32(name='BatchVersion', example='1'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model GetAiOutboundTaskProgressResponseBody = {
  code?: string(name='Code', example='ok'),
  data?: {
    calloutProgress?: {
      callLossCount?: int32(name='CallLossCount', example='1'),
      callLossRate?: float(name='CallLossRate', example='0.01'),
      callOutConnectCount?: int32(name='CallOutConnectCount', example='5'),
      callOutConnectRate?: float(name='CallOutConnectRate', example='0.5'),
      callOutCount?: int32(name='CallOutCount', example='10'),
      callOutServicerPickupCount?: int32(name='CallOutServicerPickupCount', example='4'),
      callOutServicerPickupRate?: float(name='CallOutServicerPickupRate', example='0.4'),
      callOutUserPickupCount?: int32(name='CallOutUserPickupCount', example='5'),
      callOutUserPickupRate?: float(name='CallOutUserPickupRate', example='0.5'),
    }(name='CalloutProgress'),
    taskId?: long(name='TaskId', example='123456'),
    taskProgress?: {
      callingCount?: int32(name='CallingCount', example='2'),
      connectCount?: int32(name='ConnectCount', example='2'),
      connectRate?: float(name='ConnectRate', example='0.2'),
      finishCount?: int32(name='FinishCount', example='2'),
      finishRate?: float(name='FinishRate', example='0.20'),
      servicerPickupCount?: int32(name='ServicerPickupCount', example='2'),
      servicerPickupRate?: float(name='ServicerPickupRate', example='0.2'),
      terminateCount?: int32(name='TerminateCount', example='2'),
      totalCount?: int32(name='TotalCount', example='10'),
      userPickupCount?: int32(name='UserPickupCount', example='2'),
      userPickupRate?: float(name='UserPickupRate', example='0.2'),
      waitingCallCount?: int32(name='WaitingCallCount', example='2'),
      waitingRecallCount?: int32(name='WaitingRecallCount', example='2'),
    }(name='TaskProgress'),
    type?: int32(name='Type', example='2'),
  }(name='Data'),
  message?: string(name='Message', example='ok'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model GetAiOutboundTaskProgressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAiOutboundTaskProgressResponseBody(name='body'),
}

/**
 * @summary 智能外呼任务执行进度
 *
 * @param request GetAiOutboundTaskProgressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAiOutboundTaskProgressResponse
 */
async function getAiOutboundTaskProgressWithOptions(request: GetAiOutboundTaskProgressRequest, runtime: Util.RuntimeOptions): GetAiOutboundTaskProgressResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAiOutboundTaskProgress',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 智能外呼任务执行进度
 *
 * @param request GetAiOutboundTaskProgressRequest
 * @return GetAiOutboundTaskProgressResponse
 */
async function getAiOutboundTaskProgress(request: GetAiOutboundTaskProgressRequest): GetAiOutboundTaskProgressResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiOutboundTaskProgressWithOptions(request, runtime);
}

model GetAllDepartmentRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GetAllDepartmentResponseBody = {
  code?: string(name='Code', example='200'),
  data?: [ 
    {
      departmentId?: long(name='DepartmentId', example='10'),
      departmentName?: string(name='DepartmentName'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='98B032F5-6473-4EAC-8BA8-C28993513A1F'),
  success?: boolean(name='Success', example='true'),
}

model GetAllDepartmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAllDepartmentResponseBody(name='body'),
}

/**
 * @summary getAllDepartment
 *
 * @param request GetAllDepartmentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAllDepartmentResponse
 */
async function getAllDepartmentWithOptions(request: GetAllDepartmentRequest, runtime: Util.RuntimeOptions): GetAllDepartmentResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAllDepartment',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary getAllDepartment
 *
 * @param request GetAllDepartmentRequest
 * @return GetAllDepartmentResponse
 */
async function getAllDepartment(request: GetAllDepartmentRequest): GetAllDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAllDepartmentWithOptions(request, runtime);
}

model GetCallSoundRecordRequest {
  callId?: string(name='CallId', description='This parameter is required.', example='125165515022^11195613****'),
  createTime?: string(name='CreateTime', description='This parameter is required.', example='2021-10-15 08:56:23'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetCallSoundRecordResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='http://aliccrec-shvpc.oss-cn-shanghai.aliyuncs.com/accrec_tmp/1001067****.wav'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model GetCallSoundRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCallSoundRecordResponseBody(name='body'),
}

/**
 * @summary 获取通话录音文件
 *
 * @param request GetCallSoundRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCallSoundRecordResponse
 */
async function getCallSoundRecordWithOptions(request: GetCallSoundRecordRequest, runtime: Util.RuntimeOptions): GetCallSoundRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.createTime)) {
    query['CreateTime'] = request.createTime;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCallSoundRecord',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取通话录音文件
 *
 * @param request GetCallSoundRecordRequest
 * @return GetCallSoundRecordResponse
 */
async function getCallSoundRecord(request: GetCallSoundRecordRequest): GetCallSoundRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCallSoundRecordWithOptions(request, runtime);
}

model GetConfigNumListRequest {
  accountName?: string(name='AccountName', example='123@123.com'),
  departmentId?: long(name='DepartmentId', example='12345'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GetConfigNumListResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: [ string ](name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE339D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetConfigNumListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetConfigNumListResponseBody(name='body'),
}

/**
 * @summary 获取热线配置号码列表
 *
 * @param request GetConfigNumListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetConfigNumListResponse
 */
async function getConfigNumListWithOptions(request: GetConfigNumListRequest, runtime: Util.RuntimeOptions): GetConfigNumListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetConfigNumList',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取热线配置号码列表
 *
 * @param request GetConfigNumListRequest
 * @return GetConfigNumListResponse
 */
async function getConfigNumList(request: GetConfigNumListRequest): GetConfigNumListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConfigNumListWithOptions(request, runtime);
}

model GetCustomerInfoRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  memberId?: long(name='MemberId', description='This parameter is required.', example='82345678****'),
}

model GetCustomerInfoResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    customizeFields?: map[string]any(name='CustomizeFields'),
    nick?: string(name='Nick'),
    outerId?: string(name='OuterId', example='6666666'),
    photo?: string(name='Photo', example='https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTLSW7XPFlJDwVunXP8pr84TvltwtLlNqTlOVSFeM3bCgn57mAB4JuZZmvMW0qicqW0PyzyUdZpxiaFQ'),
    realName?: string(name='RealName'),
    userId?: long(name='UserId', example='823456789023'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='DF6A3FB7-A5AA-43BE-A65B'),
  success?: boolean(name='Success', example='true'),
}

model GetCustomerInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCustomerInfoResponseBody(name='body'),
}

/**
 * @summary 获取会员信息
 *
 * @param request GetCustomerInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCustomerInfoResponse
 */
async function getCustomerInfoWithOptions(request: GetCustomerInfoRequest, runtime: Util.RuntimeOptions): GetCustomerInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCustomerInfo',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取会员信息
 *
 * @param request GetCustomerInfoRequest
 * @return GetCustomerInfoResponse
 */
async function getCustomerInfo(request: GetCustomerInfoRequest): GetCustomerInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCustomerInfoWithOptions(request, runtime);
}

model GetDepGroupTreeDataRequest {
  agentId?: long(name='AgentId', description='This parameter is required.', example='123456'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GetDepGroupTreeDataResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: [ 
    {
      depGroupId?: string(name='DepGroupId', example='10'),
      depGroupName?: string(name='DepGroupName'),
      groupDTOS?: [ 
        {
          name?: string(name='Name'),
          skillGroupId?: long(name='SkillGroupId', example='555555'),
        }
      ](name='GroupDTOS'),
    }
  ](name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetDepGroupTreeDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDepGroupTreeDataResponseBody(name='body'),
}

/**
 * @summary 获取技能组分组
 *
 * @param request GetDepGroupTreeDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDepGroupTreeDataResponse
 */
async function getDepGroupTreeDataWithOptions(request: GetDepGroupTreeDataRequest, runtime: Util.RuntimeOptions): GetDepGroupTreeDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDepGroupTreeData',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取技能组分组
 *
 * @param request GetDepGroupTreeDataRequest
 * @return GetDepGroupTreeDataResponse
 */
async function getDepGroupTreeData(request: GetDepGroupTreeDataRequest): GetDepGroupTreeDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDepGroupTreeDataWithOptions(request, runtime);
}

model GetDepartmentalLatitudeAgentStatusRequest {
  currentPage?: long(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: long(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetDepartmentalLatitudeAgentStatusShrinkRequest {
  currentPage?: long(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: long(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetDepartmentalLatitudeAgentStatusResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rows?: string(name='Rows'),
    totalNum?: int32(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='message'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetDepartmentalLatitudeAgentStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDepartmentalLatitudeAgentStatusResponseBody(name='body'),
}

/**
 * @summary 部门纬度坐席状态量
 *
 * @param tmpReq GetDepartmentalLatitudeAgentStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDepartmentalLatitudeAgentStatusResponse
 */
async function getDepartmentalLatitudeAgentStatusWithOptions(tmpReq: GetDepartmentalLatitudeAgentStatusRequest, runtime: Util.RuntimeOptions): GetDepartmentalLatitudeAgentStatusResponse {
  Util.validateModel(tmpReq);
  var request = new GetDepartmentalLatitudeAgentStatusShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDepartmentalLatitudeAgentStatus',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 部门纬度坐席状态量
 *
 * @param request GetDepartmentalLatitudeAgentStatusRequest
 * @return GetDepartmentalLatitudeAgentStatusResponse
 */
async function getDepartmentalLatitudeAgentStatus(request: GetDepartmentalLatitudeAgentStatusRequest): GetDepartmentalLatitudeAgentStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDepartmentalLatitudeAgentStatusWithOptions(request, runtime);
}

model GetHotlineAgentDetailRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@****.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GetHotlineAgentDetailResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: {
    agentId?: long(name='AgentId', example='2235****'),
    agentStatus?: int32(name='AgentStatus', example='1'),
    agentStatusCode?: string(name='AgentStatusCode', example='AgentCheckout'),
    assigned?: boolean(name='Assigned', example='false'),
    restType?: int32(name='RestType', example='1'),
    tenantId?: long(name='TenantId', example='ccc_xp_pre-cn-***'),
    token?: string(name='Token', example='dnthF_oinHg7JMJDmKqex3Ux****'),
  }(name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetHotlineAgentDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHotlineAgentDetailResponseBody(name='body'),
}

/**
 * @param request GetHotlineAgentDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHotlineAgentDetailResponse
 */
async function getHotlineAgentDetailWithOptions(request: GetHotlineAgentDetailRequest, runtime: Util.RuntimeOptions): GetHotlineAgentDetailResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetHotlineAgentDetail',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetHotlineAgentDetailRequest
 * @return GetHotlineAgentDetailResponse
 */
async function getHotlineAgentDetail(request: GetHotlineAgentDetailRequest): GetHotlineAgentDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineAgentDetailWithOptions(request, runtime);
}

model GetHotlineAgentDetailReportRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', description='This parameter is required.', example='1614824972'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='10'),
  startDate?: long(name='StartDate', description='This parameter is required.', example='1614824872'),
}

model GetHotlineAgentDetailReportResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: {
    columns?: [ 
      {
        key?: string(name='Key', example='realName'),
        title?: string(name='Title'),
      }
    ](name='Columns'),
    page?: int32(name='Page', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    rows?: [  map[string]any ](name='Rows'),
    total?: int32(name='Total', example='7'),
  }(name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetHotlineAgentDetailReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHotlineAgentDetailReportResponseBody(name='body'),
}

/**
 * @param request GetHotlineAgentDetailReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHotlineAgentDetailReportResponse
 */
async function getHotlineAgentDetailReportWithOptions(request: GetHotlineAgentDetailReportRequest, runtime: Util.RuntimeOptions): GetHotlineAgentDetailReportResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.depIds)) {
    query['DepIds'] = request.depIds;
  }
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.groupIds)) {
    query['GroupIds'] = request.groupIds;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetHotlineAgentDetailReport',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetHotlineAgentDetailReportRequest
 * @return GetHotlineAgentDetailReportResponse
 */
async function getHotlineAgentDetailReport(request: GetHotlineAgentDetailReportRequest): GetHotlineAgentDetailReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineAgentDetailReportWithOptions(request, runtime);
}

model GetHotlineAgentStatusRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@****.com'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GetHotlineAgentStatusResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: string(name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetHotlineAgentStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHotlineAgentStatusResponseBody(name='body'),
}

/**
 * @param request GetHotlineAgentStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHotlineAgentStatusResponse
 */
async function getHotlineAgentStatusWithOptions(request: GetHotlineAgentStatusRequest, runtime: Util.RuntimeOptions): GetHotlineAgentStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetHotlineAgentStatus',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetHotlineAgentStatusRequest
 * @return GetHotlineAgentStatusResponse
 */
async function getHotlineAgentStatus(request: GetHotlineAgentStatusRequest): GetHotlineAgentStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineAgentStatusWithOptions(request, runtime);
}

model GetHotlineCallActionRequest {
  acc?: string(name='Acc', example='{"time":1}'),
  accountName?: string(name='AccountName', example='username@example.com'),
  act?: int32(name='Act', example='1'),
  biz?: string(name='Biz', example='{"name":123}'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d9****'),
  fromSource?: string(name='FromSource', example='hotlinebs_out'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GetHotlineCallActionResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: {
    actionId?: long(name='ActionId', example='8999****'),
    buId?: long(name='BuId', example='2367****'),
    calloutId?: long(name='CalloutId', example='1122****'),
    calloutName?: string(name='CalloutName'),
    caseId?: long(name='CaseId', example='1138902****'),
    channelId?: string(name='ChannelId', example='2377****'),
    channelType?: long(name='ChannelType', example='2'),
    depId?: long(name='DepId', example='1223****'),
    isTransfer?: string(name='IsTransfer', example='true'),
    memberId?: long(name='MemberId', example='7856876****'),
    memberList?: string(name='MemberList', example='8900****'),
    memberName?: string(name='MemberName'),
    servicerId?: long(name='ServicerId', example='1332****'),
    servicerName?: string(name='ServicerName'),
    subTouchId?: long(name='SubTouchId', example='3423****'),
    taskId?: long(name='TaskId', example='12345****'),
    touchId?: long(name='TouchId', example='2235****'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE339D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetHotlineCallActionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHotlineCallActionResponseBody(name='body'),
}

/**
 * @summary 查询话务动作结果数据
 *
 * @param request GetHotlineCallActionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHotlineCallActionResponse
 */
async function getHotlineCallActionWithOptions(request: GetHotlineCallActionRequest, runtime: Util.RuntimeOptions): GetHotlineCallActionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.acc)) {
    body['Acc'] = request.acc;
  }
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.act)) {
    body['Act'] = request.act;
  }
  if (!Util.isUnset(request.biz)) {
    body['Biz'] = request.biz;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.fromSource)) {
    body['FromSource'] = request.fromSource;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetHotlineCallAction',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询话务动作结果数据
 *
 * @param request GetHotlineCallActionRequest
 * @return GetHotlineCallActionResponse
 */
async function getHotlineCallAction(request: GetHotlineCallActionRequest): GetHotlineCallActionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineCallActionWithOptions(request, runtime);
}

model GetHotlineGroupDetailReportRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', description='This parameter is required.', example='1614824972'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', description='This parameter is required.', example='1614824872'),
}

model GetHotlineGroupDetailReportResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: {
    columns?: [ 
      {
        key?: string(name='Key', example='skillGroupName'),
        title?: string(name='Title'),
      }
    ](name='Columns'),
    page?: int32(name='Page', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    rows?: [  map[string]any ](name='Rows'),
    total?: int32(name='Total', example='9'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='Public'),
}

model GetHotlineGroupDetailReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHotlineGroupDetailReportResponseBody(name='body'),
}

/**
 * @param request GetHotlineGroupDetailReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHotlineGroupDetailReportResponse
 */
async function getHotlineGroupDetailReportWithOptions(request: GetHotlineGroupDetailReportRequest, runtime: Util.RuntimeOptions): GetHotlineGroupDetailReportResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.depIds)) {
    query['DepIds'] = request.depIds;
  }
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.groupIds)) {
    query['GroupIds'] = request.groupIds;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetHotlineGroupDetailReport',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetHotlineGroupDetailReportRequest
 * @return GetHotlineGroupDetailReportResponse
 */
async function getHotlineGroupDetailReport(request: GetHotlineGroupDetailReportRequest): GetHotlineGroupDetailReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineGroupDetailReportWithOptions(request, runtime);
}

model GetHotlineMessageLogRequest {
  acid?: string(name='Acid', description='This parameter is required.', example='100****2077'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GetHotlineMessageLogResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: [ 
    {
      acid?: string(name='Acid', example='100****2077'),
      content?: string(name='Content'),
      endTime?: long(name='EndTime', example='1623738027480'),
      mid?: string(name='Mid', example='11deca999****'),
      senderType?: int32(name='SenderType', example='1'),
      startTime?: long(name='StartTime', example='1623738026460'),
    }
  ](name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetHotlineMessageLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHotlineMessageLogResponseBody(name='body'),
}

/**
 * @summary 获取热线聊天记录
 *
 * @param request GetHotlineMessageLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHotlineMessageLogResponse
 */
async function getHotlineMessageLogWithOptions(request: GetHotlineMessageLogRequest, runtime: Util.RuntimeOptions): GetHotlineMessageLogResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetHotlineMessageLog',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取热线聊天记录
 *
 * @param request GetHotlineMessageLogRequest
 * @return GetHotlineMessageLogResponse
 */
async function getHotlineMessageLog(request: GetHotlineMessageLogRequest): GetHotlineMessageLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineMessageLogWithOptions(request, runtime);
}

model GetHotlineRuntimeInfoRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@****.com'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GetHotlineRuntimeInfoResponseBody = {
  code?: string(name='Code', example='200'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetHotlineRuntimeInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHotlineRuntimeInfoResponseBody(name='body'),
}

/**
 * @summary 获取热线当前信息
 *
 * @param request GetHotlineRuntimeInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHotlineRuntimeInfoResponse
 */
async function getHotlineRuntimeInfoWithOptions(request: GetHotlineRuntimeInfoRequest, runtime: Util.RuntimeOptions): GetHotlineRuntimeInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetHotlineRuntimeInfo',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取热线当前信息
 *
 * @param request GetHotlineRuntimeInfoRequest
 * @return GetHotlineRuntimeInfoResponse
 */
async function getHotlineRuntimeInfo(request: GetHotlineRuntimeInfoRequest): GetHotlineRuntimeInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineRuntimeInfoWithOptions(request, runtime);
}

model GetHotlineServiceStatisticsRequest {
  agentIds?: [ long ](name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='true'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='true'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='10'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetHotlineServiceStatisticsShrinkRequest {
  agentIdsShrink?: string(name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='true'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='true'),
  groupIdsShrink?: string(name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='10'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetHotlineServiceStatisticsResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rows?: string(name='Rows'),
    totalNum?: int32(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='message'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetHotlineServiceStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHotlineServiceStatisticsResponseBody(name='body'),
}

/**
 * @summary 服务统计量数据
 *
 * @param tmpReq GetHotlineServiceStatisticsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHotlineServiceStatisticsResponse
 */
async function getHotlineServiceStatisticsWithOptions(tmpReq: GetHotlineServiceStatisticsRequest, runtime: Util.RuntimeOptions): GetHotlineServiceStatisticsResponse {
  Util.validateModel(tmpReq);
  var request = new GetHotlineServiceStatisticsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetHotlineServiceStatistics',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 服务统计量数据
 *
 * @param request GetHotlineServiceStatisticsRequest
 * @return GetHotlineServiceStatisticsResponse
 */
async function getHotlineServiceStatistics(request: GetHotlineServiceStatisticsRequest): GetHotlineServiceStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineServiceStatisticsWithOptions(request, runtime);
}

model GetHotlineWaitingNumberRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GetHotlineWaitingNumberResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: long(name='Data', example='2'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetHotlineWaitingNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHotlineWaitingNumberResponseBody(name='body'),
}

/**
 * @param request GetHotlineWaitingNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHotlineWaitingNumberResponse
 */
async function getHotlineWaitingNumberWithOptions(request: GetHotlineWaitingNumberRequest, runtime: Util.RuntimeOptions): GetHotlineWaitingNumberResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetHotlineWaitingNumber',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetHotlineWaitingNumberRequest
 * @return GetHotlineWaitingNumberResponse
 */
async function getHotlineWaitingNumber(request: GetHotlineWaitingNumberRequest): GetHotlineWaitingNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineWaitingNumberWithOptions(request, runtime);
}

model GetIndexCurrentValueRequest {
  depIds?: string(name='DepIds', example='2332****,2334****'),
  groupIds?: string(name='GroupIds', example='2323****,2324****'),
  instanceId?: string(name='InstanceId', example='ccc_xp_pre-cn-***'),
}

model GetIndexCurrentValueResponseBody = {
  code?: string(name='Code', example='200'),
  data?: [  map[string]any ](name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetIndexCurrentValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIndexCurrentValueResponseBody(name='body'),
}

/**
 * @param request GetIndexCurrentValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIndexCurrentValueResponse
 */
async function getIndexCurrentValueWithOptions(request: GetIndexCurrentValueRequest, runtime: Util.RuntimeOptions): GetIndexCurrentValueResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.depIds)) {
    query['DepIds'] = request.depIds;
  }
  if (!Util.isUnset(request.groupIds)) {
    query['GroupIds'] = request.groupIds;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetIndexCurrentValue',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetIndexCurrentValueRequest
 * @return GetIndexCurrentValueResponse
 */
async function getIndexCurrentValue(request: GetIndexCurrentValueRequest): GetIndexCurrentValueResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIndexCurrentValueWithOptions(request, runtime);
}

model GetInstanceListRequest {
  name?: string(name='Name'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
}

model GetInstanceListResponseBody = {
  code?: string(name='Code'),
  commodityInstances?: [ 
    {
      instanceId?: string(name='InstanceId'),
      name?: string(name='Name'),
    }
  ](name='CommodityInstances'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: int32(name='TotalCount'),
}

model GetInstanceListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInstanceListResponseBody(name='body'),
}

/**
 * @param request GetInstanceListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInstanceListResponse
 */
async function getInstanceListWithOptions(request: GetInstanceListRequest, runtime: Util.RuntimeOptions): GetInstanceListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceList',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetInstanceListRequest
 * @return GetInstanceListResponse
 */
async function getInstanceList(request: GetInstanceListRequest): GetInstanceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInstanceListWithOptions(request, runtime);
}

model GetMcuLvsIpRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre***'),
}

model GetMcuLvsIpResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='{ "xmculvs":[ 0:{ "port":00 "ip":"0.0.0.0" "name":"lvs1" } ]}'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetMcuLvsIpResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMcuLvsIpResponseBody(name='body'),
}

/**
 * @summary 热线检测获取mcu ip地址
 *
 * @param request GetMcuLvsIpRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMcuLvsIpResponse
 */
async function getMcuLvsIpWithOptions(request: GetMcuLvsIpRequest, runtime: Util.RuntimeOptions): GetMcuLvsIpResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMcuLvsIp',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 热线检测获取mcu ip地址
 *
 * @param request GetMcuLvsIpRequest
 * @return GetMcuLvsIpResponse
 */
async function getMcuLvsIp(request: GetMcuLvsIpRequest): GetMcuLvsIpResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMcuLvsIpWithOptions(request, runtime);
}

model GetNumLocationRequest {
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  phoneNum?: string(name='PhoneNum', description='This parameter is required.', example='1360987****'),
}

model GetNumLocationResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: string(name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetNumLocationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetNumLocationResponseBody(name='body'),
}

/**
 * @param request GetNumLocationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetNumLocationResponse
 */
async function getNumLocationWithOptions(request: GetNumLocationRequest, runtime: Util.RuntimeOptions): GetNumLocationResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetNumLocation',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetNumLocationRequest
 * @return GetNumLocationResponse
 */
async function getNumLocation(request: GetNumLocationRequest): GetNumLocationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getNumLocationWithOptions(request, runtime);
}

model GetOnlineSeatInformationRequest {
  agentIds?: [ long ](name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetOnlineSeatInformationShrinkRequest {
  agentIdsShrink?: string(name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetOnlineSeatInformationResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rows?: string(name='Rows'),
    totalNum?: int32(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetOnlineSeatInformationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetOnlineSeatInformationResponseBody(name='body'),
}

/**
 * @summary 在线坐席信息
 *
 * @param tmpReq GetOnlineSeatInformationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetOnlineSeatInformationResponse
 */
async function getOnlineSeatInformationWithOptions(tmpReq: GetOnlineSeatInformationRequest, runtime: Util.RuntimeOptions): GetOnlineSeatInformationResponse {
  Util.validateModel(tmpReq);
  var request = new GetOnlineSeatInformationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOnlineSeatInformation',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 在线坐席信息
 *
 * @param request GetOnlineSeatInformationRequest
 * @return GetOnlineSeatInformationResponse
 */
async function getOnlineSeatInformation(request: GetOnlineSeatInformationRequest): GetOnlineSeatInformationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOnlineSeatInformationWithOptions(request, runtime);
}

model GetOnlineServiceVolumeRequest {
  agentIds?: [ long ](name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='false'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='false'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='false'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetOnlineServiceVolumeShrinkRequest {
  agentIdsShrink?: string(name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='false'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='false'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='false'),
  groupIdsShrink?: string(name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetOnlineServiceVolumeResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rows?: string(name='Rows', example='{"tenant_id":"905","online_40s_transfer_ready_cnt":109,"minute_id":"-1","wait_time_len":1215,"pickup_rate":"63.09%","thirty_seconds_to_pickUp":"2560","date_id":"-1","online_over_out_cnt":0,"online_20s_transfer_ready_cnt":109,"thirty_seconds_response_rate":"63.09%","abandonment_rate":"63.09%","service_time_len":68378,"service_pickup":"2560","hour_id":"-1","online_10s_transfer_ready_cnt":109}'),
    totalNum?: int32(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetOnlineServiceVolumeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetOnlineServiceVolumeResponseBody(name='body'),
}

/**
 * @summary 在线服务总量
 *
 * @param tmpReq GetOnlineServiceVolumeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetOnlineServiceVolumeResponse
 */
async function getOnlineServiceVolumeWithOptions(tmpReq: GetOnlineServiceVolumeRequest, runtime: Util.RuntimeOptions): GetOnlineServiceVolumeResponse {
  Util.validateModel(tmpReq);
  var request = new GetOnlineServiceVolumeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOnlineServiceVolume',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 在线服务总量
 *
 * @param request GetOnlineServiceVolumeRequest
 * @return GetOnlineServiceVolumeResponse
 */
async function getOnlineServiceVolume(request: GetOnlineServiceVolumeRequest): GetOnlineServiceVolumeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOnlineServiceVolumeWithOptions(request, runtime);
}

model GetOutbounNumListRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@****.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-****'),
}

model GetOutbounNumListResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: {
    num?: [ 
      {
        description?: string(name='Description'),
        type?: int32(name='Type', example='1'),
        value?: string(name='Value', example='07512234****'),
      }
    ](name='Num'),
    numGroup?: [ 
      {
        description?: string(name='Description', example='Jella'),
        type?: int32(name='Type', example='2'),
        value?: string(name='Value', example='7688****'),
      }
    ](name='NumGroup'),
  }(name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetOutbounNumListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetOutbounNumListResponseBody(name='body'),
}

/**
 * @param request GetOutbounNumListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetOutbounNumListResponse
 */
async function getOutbounNumListWithOptions(request: GetOutbounNumListRequest, runtime: Util.RuntimeOptions): GetOutbounNumListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetOutbounNumList',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetOutbounNumListRequest
 * @return GetOutbounNumListResponse
 */
async function getOutbounNumList(request: GetOutbounNumListRequest): GetOutbounNumListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOutbounNumListWithOptions(request, runtime);
}

model GetQualityProjectDetailRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre***'),
  projectId?: long(name='ProjectId', description='This parameter is required.', example='15977801'),
}

model GetQualityProjectDetailResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    checkFreqType?: int32(name='CheckFreqType', example='1'),
    createTime?: string(name='CreateTime', example='2021-04-07 18:07:18'),
    depList?: [ long ](name='DepList'),
    groupList?: [ long ](name='GroupList'),
    id?: long(name='Id', example='15977801'),
    modifyTime?: string(name='ModifyTime', example='2021-04-07 18:07:19'),
    projectName?: string(name='ProjectName'),
    qualityRuleIds?: [ long ](name='QualityRuleIds'),
    qualityType?: int32(name='QualityType', example='1'),
    servicerList?: [ long ](name='ServicerList'),
    status?: int32(name='Status', example='0'),
    version?: int32(name='Version', example='1'),
  }(name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetQualityProjectDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQualityProjectDetailResponseBody(name='body'),
}

/**
 * @param request GetQualityProjectDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQualityProjectDetailResponse
 */
async function getQualityProjectDetailWithOptions(request: GetQualityProjectDetailRequest, runtime: Util.RuntimeOptions): GetQualityProjectDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQualityProjectDetail',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetQualityProjectDetailRequest
 * @return GetQualityProjectDetailResponse
 */
async function getQualityProjectDetail(request: GetQualityProjectDetailRequest): GetQualityProjectDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityProjectDetailWithOptions(request, runtime);
}

model GetQualityProjectListRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre***'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projectId?: long(name='ProjectId', example='15'),
  projectName?: string(name='ProjectName'),
  status?: int32(name='Status', example='0'),
  checkFreqType?: long(name='checkFreqType', example='1'),
}

model GetQualityProjectListResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNo?: int32(name='PageNo', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    qualityProjectList?: [ 
      {
        checkFreqType?: int32(name='CheckFreqType', example='1'),
        createTime?: string(name='CreateTime', example='2021-04-07 18:07:18'),
        depList?: [ long ](name='DepList'),
        groupList?: [ long ](name='GroupList'),
        id?: long(name='Id', example='15977801'),
        modifyTime?: string(name='ModifyTime', example='2021-04-07 18:07:19'),
        projectName?: string(name='ProjectName'),
        qualityRuleIds?: [ long ](name='QualityRuleIds'),
        qualityType?: int32(name='QualityType', example='1'),
        servicerList?: [ long ](name='ServicerList'),
        status?: int32(name='Status', example='0'),
        version?: int32(name='Version', example='1'),
      }
    ](name='QualityProjectList'),
    total?: long(name='Total', example='35'),
  }(name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetQualityProjectListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQualityProjectListResponseBody(name='body'),
}

/**
 * @param request GetQualityProjectListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQualityProjectListResponse
 */
async function getQualityProjectListWithOptions(request: GetQualityProjectListRequest, runtime: Util.RuntimeOptions): GetQualityProjectListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.checkFreqType)) {
    query['checkFreqType'] = request.checkFreqType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQualityProjectList',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetQualityProjectListRequest
 * @return GetQualityProjectListResponse
 */
async function getQualityProjectList(request: GetQualityProjectListRequest): GetQualityProjectListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityProjectListWithOptions(request, runtime);
}

model GetQualityProjectLogRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  projectId?: long(name='ProjectId'),
}

model GetQualityProjectLogResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      actionData?: string(name='ActionData'),
      actionTime?: string(name='ActionTime'),
      actionType?: string(name='ActionType'),
      projectCreateTime?: string(name='ProjectCreateTime'),
      projectId?: long(name='ProjectId'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetQualityProjectLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQualityProjectLogResponseBody(name='body'),
}

/**
 * @param request GetQualityProjectLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQualityProjectLogResponse
 */
async function getQualityProjectLogWithOptions(request: GetQualityProjectLogRequest, runtime: Util.RuntimeOptions): GetQualityProjectLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQualityProjectLog',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetQualityProjectLogRequest
 * @return GetQualityProjectLogResponse
 */
async function getQualityProjectLog(request: GetQualityProjectLogRequest): GetQualityProjectLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityProjectLogWithOptions(request, runtime);
}

model GetQualityResultRequest {
  channelType?: string(name='ChannelType'),
  groupIds?: [ long ](name='GroupIds'),
  hitStatus?: int32(name='HitStatus'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
  projectIds?: [ long ](name='ProjectIds'),
  qualityRuleIds?: [ long ](name='QualityRuleIds'),
  touchEndTime?: string(name='TouchEndTime', description='This parameter is required.'),
  touchStartTime?: string(name='TouchStartTime', description='This parameter is required.'),
}

model GetQualityResultResponseBody = {
  channelTypeName?: string(name='ChannelTypeName'),
  code?: string(name='Code'),
  data?: {
    pageNo?: int32(name='PageNo'),
    pageSize?: int32(name='PageSize'),
    qualityResultResponseList?: [ 
      {
        channelType?: string(name='ChannelType'),
        channelTypeName?: string(name='ChannelTypeName'),
        groupId?: string(name='GroupId'),
        groupName?: string(name='GroupName'),
        hitDetail?: string(name='HitDetail'),
        hitStatus?: boolean(name='HitStatus'),
        instanceName?: string(name='InstanceName'),
        memberName?: string(name='MemberName'),
        projectId?: string(name='ProjectId'),
        projectName?: string(name='ProjectName'),
        ruleId?: string(name='RuleId'),
        ruleName?: string(name='RuleName'),
        servicerId?: string(name='ServicerId'),
        servicerName?: string(name='ServicerName'),
        touchId?: string(name='TouchId'),
        touchStartTime?: string(name='TouchStartTime'),
      }
    ](name='QualityResultResponseList'),
    totalNum?: int32(name='TotalNum'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetQualityResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQualityResultResponseBody(name='body'),
}

/**
 * @param request GetQualityResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQualityResultResponse
 */
async function getQualityResultWithOptions(request: GetQualityResultRequest, runtime: Util.RuntimeOptions): GetQualityResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.channelType)) {
    query['ChannelType'] = request.channelType;
  }
  if (!Util.isUnset(request.groupIds)) {
    query['GroupIds'] = request.groupIds;
  }
  if (!Util.isUnset(request.hitStatus)) {
    query['HitStatus'] = request.hitStatus;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectIds)) {
    query['ProjectIds'] = request.projectIds;
  }
  if (!Util.isUnset(request.qualityRuleIds)) {
    query['QualityRuleIds'] = request.qualityRuleIds;
  }
  if (!Util.isUnset(request.touchEndTime)) {
    query['TouchEndTime'] = request.touchEndTime;
  }
  if (!Util.isUnset(request.touchStartTime)) {
    query['TouchStartTime'] = request.touchStartTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQualityResult',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetQualityResultRequest
 * @return GetQualityResultResponse
 */
async function getQualityResult(request: GetQualityResultRequest): GetQualityResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityResultWithOptions(request, runtime);
}

model GetQualityRuleDetailRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  qualityRuleId?: long(name='QualityRuleId', description='This parameter is required.'),
}

model GetQualityRuleDetailResponseBody = {
  code?: string(name='Code'),
  data?: {
    keyWords?: [ string ](name='KeyWords'),
    matchType?: int32(name='MatchType'),
    name?: string(name='Name'),
    ruleCreateTime?: string(name='RuleCreateTime'),
    ruleId?: long(name='RuleId'),
    ruleTag?: int32(name='RuleTag'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetQualityRuleDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQualityRuleDetailResponseBody(name='body'),
}

/**
 * @param request GetQualityRuleDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQualityRuleDetailResponse
 */
async function getQualityRuleDetailWithOptions(request: GetQualityRuleDetailRequest, runtime: Util.RuntimeOptions): GetQualityRuleDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.qualityRuleId)) {
    query['QualityRuleId'] = request.qualityRuleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQualityRuleDetail',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetQualityRuleDetailRequest
 * @return GetQualityRuleDetailResponse
 */
async function getQualityRuleDetail(request: GetQualityRuleDetailRequest): GetQualityRuleDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityRuleDetailWithOptions(request, runtime);
}

model GetQualityRuleListRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
}

model GetQualityRuleListResponseBody = {
  code?: string(name='Code'),
  data?: {
    pageNo?: int32(name='PageNo'),
    pageSize?: int32(name='PageSize'),
    qualityRuleList?: [ 
      {
        keyWords?: [ string ](name='KeyWords'),
        matchType?: int32(name='MatchType'),
        name?: string(name='Name'),
        ruleCreateTime?: string(name='RuleCreateTime'),
        ruleId?: long(name='RuleId'),
        ruleTag?: int32(name='RuleTag'),
      }
    ](name='QualityRuleList'),
    total?: long(name='Total'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetQualityRuleListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQualityRuleListResponseBody(name='body'),
}

/**
 * @param request GetQualityRuleListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQualityRuleListResponse
 */
async function getQualityRuleListWithOptions(request: GetQualityRuleListRequest, runtime: Util.RuntimeOptions): GetQualityRuleListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQualityRuleList',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetQualityRuleListRequest
 * @return GetQualityRuleListResponse
 */
async function getQualityRuleList(request: GetQualityRuleListRequest): GetQualityRuleListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityRuleListWithOptions(request, runtime);
}

model GetQualityRuleTagListRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model GetQualityRuleTagListResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      ruleTagId?: long(name='RuleTagId'),
      ruleTagName?: string(name='RuleTagName'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetQualityRuleTagListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQualityRuleTagListResponseBody(name='body'),
}

/**
 * @param request GetQualityRuleTagListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQualityRuleTagListResponse
 */
async function getQualityRuleTagListWithOptions(request: GetQualityRuleTagListRequest, runtime: Util.RuntimeOptions): GetQualityRuleTagListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQualityRuleTagList',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetQualityRuleTagListRequest
 * @return GetQualityRuleTagListResponse
 */
async function getQualityRuleTagList(request: GetQualityRuleTagListRequest): GetQualityRuleTagListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityRuleTagListWithOptions(request, runtime);
}

model GetQueueInformationRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='false'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='fasle'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetQueueInformationShrinkRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='false'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='fasle'),
  groupIdsShrink?: string(name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetQueueInformationResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rows?: string(name='Rows'),
    totalNum?: int32(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetQueueInformationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQueueInformationResponseBody(name='body'),
}

/**
 * @summary 技能组纬度队列信息
 *
 * @param tmpReq GetQueueInformationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQueueInformationResponse
 */
async function getQueueInformationWithOptions(tmpReq: GetQueueInformationRequest, runtime: Util.RuntimeOptions): GetQueueInformationResponse {
  Util.validateModel(tmpReq);
  var request = new GetQueueInformationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQueueInformation',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 技能组纬度队列信息
 *
 * @param request GetQueueInformationRequest
 * @return GetQueueInformationResponse
 */
async function getQueueInformation(request: GetQueueInformationRequest): GetQueueInformationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQueueInformationWithOptions(request, runtime);
}

model GetRecordDataRequest {
  acid?: string(name='Acid', description='This parameter is required.', example='1001067****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model GetRecordDataResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    acid?: string(name='Acid', example='1001067****'),
    ossLink?: string(name='OssLink', example='http://aliccrec-shvpc.oss-cn-shanghai.aliyuncs.com/accrec_tmp/10010679716-12-01-56.wav?***'),
  }(name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetRecordDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRecordDataResponseBody(name='body'),
}

/**
 * @param request GetRecordDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRecordDataResponse
 */
async function getRecordDataWithOptions(request: GetRecordDataRequest, runtime: Util.RuntimeOptions): GetRecordDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acid)) {
    query['Acid'] = request.acid;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRecordData',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetRecordDataRequest
 * @return GetRecordDataResponse
 */
async function getRecordData(request: GetRecordDataRequest): GetRecordDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRecordDataWithOptions(request, runtime);
}

model GetRecordUrlRequest {
  acid?: string(name='Acid', description='This parameter is required.', example='1001067****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-****'),
  recordType?: string(name='RecordType', description='This parameter is required.', example='DUP_CALL'),
}

model GetRecordUrlResponseBody = {
  data?: {
    acid?: string(name='Acid', example='1001067****'),
    ossLink?: string(name='OssLink', example='http://aliccrec-shvpc.oss-cn-shanghai.aliyuncs.com/accrec_tmp/10010679716-12-01-56.wav?***'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetRecordUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRecordUrlResponseBody(name='body'),
}

/**
 * @summary 获取录音链接
 *
 * @param request GetRecordUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRecordUrlResponse
 */
async function getRecordUrlWithOptions(request: GetRecordUrlRequest, runtime: Util.RuntimeOptions): GetRecordUrlResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRecordUrl',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取录音链接
 *
 * @param request GetRecordUrlRequest
 * @return GetRecordUrlResponse
 */
async function getRecordUrl(request: GetRecordUrlRequest): GetRecordUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRecordUrlWithOptions(request, runtime);
}

model GetRtcTokenRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='username@example.com'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
}

model GetRtcTokenResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    accountName?: string(name='AccountName', example='139000000'),
    rtcId?: string(name='RtcId', example='200000000*******'),
    token?: string(name='Token', example='{“cleansession”:true,”clientId”:”GID_VOIP@@@ClientId_****”,”conferenceTopic”:”cs_alicom_voip_conference”,”host”:”mqtt-cn-4590mdhb901.mqtt.aliyuncs.com”,”meetingEventKeepAliveInterval”:0,”phoneTopic”:”alicom_voip_phone”,”port”:0,”reconnectTimeout”:2000,”registerTime”:0,”sdkClientPort”:8883,”serverId”:”GID_VOIP@@@MTEuMTMuMTM2LjExOA==”,”sgwServerTopic”:”alicom_voip_server_pre”,”tlsport”:443,”tokenData”:”abcdef”,”useTLS”:false}'),
  }(name='Data', example='{"cleansession":true,"clientId":"GID_VOIP@@@ClientId_2000000001271771_100685295007","conferenceTopic":"cs_alicom_voip_conference_pre","dataTopic":"alicom_voip_data_pre","host":"mqtt-cn-4590mdhb901.mqtt.aliyuncs.com","meetingEventKeepAliveInterval":0,"phoneTopic":"alicom_voip_phone","port":0,"reconnectTimeout":2000,"registerTime":0,"sdkClientPort":8883,"serverId":"GID_VOIP@@@MTEuMjIuMTQ1Ljgy","sgwServerTopic":"alicom_voip_server_pre","tlsport":443,"tokenData":"LzMT+XLFl5s/YWJ/MlDz4t/Lq5HC1iGU1P28HAMaxYzmBSHQsWXgdISJ1ZJ+2cxaU0jwYsoyG8Q8cCIbLZTwwaFHf7gc7pPXbJGYgJWUr5ooKsoHaVvvG34cww7W8woWE1OsmZGFDODvooOIjF1CZSorVrR8OwRdprW99yqhMhkJKh7r5f3HfiQgoJWL8b3A85RrRGCSP057skgQ5rIqVAlx7jDFrOTdLtz+krken8qYvpaVBO9wRfFyWQLvxAgNJNx3Oql/hpzc2o3+xbKGTA/P2siLn6Nee1FYk5ClpXcnvfSTM4BAauuWR+oES10VblKEKTU5R/pfjXj3UKOlZ1+OdGO93WA16BR/l1uRb3cOLqya5pjWM+oSmo0sOR7B0ATLz6K1xA0Pc+p6Mu8hZl+OdGO93WA1kj1L0h9Z6CAZG4ol/BNdIg9z6noy7yFmX450Y73dYDWSPUvSH1noIBkbiiX8E10iT0a6ypXxupQdyyrhh8j1yw6otqnw5AT5Tj5VsVWVfflXeZ8nPt1ydXC9nWeHX7K80O6vtOU9M8Qn5VrhkP0F1umbOoYs3NfM+WYZIQx4pkViQo6qqkxgbEg1l6oHJbmOVzrxYRrDTIxqgE/pb0YVJQ==","useTLS":false,"username":"LTAI27GqAW1VrcQA"}'),
  message?: string(name='Message', example='Successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model GetRtcTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRtcTokenResponseBody(name='body'),
}

/**
 * @summary 获取RtcToken
 *
 * @param request GetRtcTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRtcTokenResponse
 */
async function getRtcTokenWithOptions(request: GetRtcTokenRequest, runtime: Util.RuntimeOptions): GetRtcTokenResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRtcToken',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取RtcToken
 *
 * @param request GetRtcTokenRequest
 * @return GetRtcTokenResponse
 */
async function getRtcToken(request: GetRtcTokenRequest): GetRtcTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRtcTokenWithOptions(request, runtime);
}

model GetSeatInformationRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  currentPage?: int32(name='currentPage', example='1'),
  depIds?: [ long ](name='depIds'),
  endDate?: long(name='endDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='existDepartmentGrouping', example='true'),
  pageSize?: int32(name='pageSize', example='10'),
  startDate?: long(name='startDate', example='1615083365000'),
}

model GetSeatInformationShrinkRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  currentPage?: int32(name='currentPage', example='1'),
  depIdsShrink?: string(name='depIds'),
  endDate?: long(name='endDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='existDepartmentGrouping', example='true'),
  pageSize?: int32(name='pageSize', example='10'),
  startDate?: long(name='startDate', example='1615083365000'),
}

model GetSeatInformationResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rowr?: string(name='Rowr'),
    totalNum?: int32(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetSeatInformationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSeatInformationResponseBody(name='body'),
}

/**
 * @summary 部门纬度坐席信息数据
 *
 * @param tmpReq GetSeatInformationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSeatInformationResponse
 */
async function getSeatInformationWithOptions(tmpReq: GetSeatInformationRequest, runtime: Util.RuntimeOptions): GetSeatInformationResponse {
  Util.validateModel(tmpReq);
  var request = new GetSeatInformationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'depIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSeatInformation',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 部门纬度坐席信息数据
 *
 * @param request GetSeatInformationRequest
 * @return GetSeatInformationResponse
 */
async function getSeatInformation(request: GetSeatInformationRequest): GetSeatInformationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSeatInformationWithOptions(request, runtime);
}

model GetSkillGroupAgentStatusDetailsRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1614824972'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='true'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='10'),
  startDate?: long(name='StartDate', example='1614824872'),
}

model GetSkillGroupAgentStatusDetailsShrinkRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1614824972'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='true'),
  groupIdsShrink?: string(name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='10'),
  startDate?: long(name='StartDate', example='1614824872'),
}

model GetSkillGroupAgentStatusDetailsResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='2000'),
    rows?: string(name='Rows'),
    totalNum?: long(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetSkillGroupAgentStatusDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSkillGroupAgentStatusDetailsResponseBody(name='body'),
}

/**
 * @summary 技能组坐席状态详情
 *
 * @param tmpReq GetSkillGroupAgentStatusDetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSkillGroupAgentStatusDetailsResponse
 */
async function getSkillGroupAgentStatusDetailsWithOptions(tmpReq: GetSkillGroupAgentStatusDetailsRequest, runtime: Util.RuntimeOptions): GetSkillGroupAgentStatusDetailsResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupAgentStatusDetailsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSkillGroupAgentStatusDetails',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 技能组坐席状态详情
 *
 * @param request GetSkillGroupAgentStatusDetailsRequest
 * @return GetSkillGroupAgentStatusDetailsResponse
 */
async function getSkillGroupAgentStatusDetails(request: GetSkillGroupAgentStatusDetailsRequest): GetSkillGroupAgentStatusDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupAgentStatusDetailsWithOptions(request, runtime);
}

model GetSkillGroupAndAgentStatusSummaryRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='false'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='false'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetSkillGroupAndAgentStatusSummaryShrinkRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='false'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='false'),
  groupIdsShrink?: string(name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetSkillGroupAndAgentStatusSummaryResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rows?: string(name='Rows'),
    totalNum?: int32(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='message'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetSkillGroupAndAgentStatusSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSkillGroupAndAgentStatusSummaryResponseBody(name='body'),
}

/**
 * @summary 技能组坐席汇总状态量
 *
 * @param tmpReq GetSkillGroupAndAgentStatusSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSkillGroupAndAgentStatusSummaryResponse
 */
async function getSkillGroupAndAgentStatusSummaryWithOptions(tmpReq: GetSkillGroupAndAgentStatusSummaryRequest, runtime: Util.RuntimeOptions): GetSkillGroupAndAgentStatusSummaryResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupAndAgentStatusSummaryShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSkillGroupAndAgentStatusSummary',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 技能组坐席汇总状态量
 *
 * @param request GetSkillGroupAndAgentStatusSummaryRequest
 * @return GetSkillGroupAndAgentStatusSummaryResponse
 */
async function getSkillGroupAndAgentStatusSummary(request: GetSkillGroupAndAgentStatusSummaryRequest): GetSkillGroupAndAgentStatusSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupAndAgentStatusSummaryWithOptions(request, runtime);
}

model GetSkillGroupLatitudeStateRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='true'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetSkillGroupLatitudeStateShrinkRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='true'),
  groupIdsShrink?: string(name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetSkillGroupLatitudeStateResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rows?: string(name='Rows'),
    totalNum?: int32(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetSkillGroupLatitudeStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSkillGroupLatitudeStateResponseBody(name='body'),
}

/**
 * @summary 技能组纬度状态量
 *
 * @param tmpReq GetSkillGroupLatitudeStateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSkillGroupLatitudeStateResponse
 */
async function getSkillGroupLatitudeStateWithOptions(tmpReq: GetSkillGroupLatitudeStateRequest, runtime: Util.RuntimeOptions): GetSkillGroupLatitudeStateResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupLatitudeStateShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSkillGroupLatitudeState',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 技能组纬度状态量
 *
 * @param request GetSkillGroupLatitudeStateRequest
 * @return GetSkillGroupLatitudeStateResponse
 */
async function getSkillGroupLatitudeState(request: GetSkillGroupLatitudeStateRequest): GetSkillGroupLatitudeStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupLatitudeStateWithOptions(request, runtime);
}

model GetSkillGroupServiceCapabilityRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='true'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='10'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetSkillGroupServiceCapabilityShrinkRequest {
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='true'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='true'),
  groupIdsShrink?: string(name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='10'),
  startDate?: long(name='StartDate', example='1615083365000'),
}

model GetSkillGroupServiceCapabilityResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rows?: string(name='Rows'),
    totalNum?: long(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetSkillGroupServiceCapabilityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSkillGroupServiceCapabilityResponseBody(name='body'),
}

/**
 * @summary 技能组纬度服务能力
 *
 * @param tmpReq GetSkillGroupServiceCapabilityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSkillGroupServiceCapabilityResponse
 */
async function getSkillGroupServiceCapabilityWithOptions(tmpReq: GetSkillGroupServiceCapabilityRequest, runtime: Util.RuntimeOptions): GetSkillGroupServiceCapabilityResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupServiceCapabilityShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSkillGroupServiceCapability',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 技能组纬度服务能力
 *
 * @param request GetSkillGroupServiceCapabilityRequest
 * @return GetSkillGroupServiceCapabilityResponse
 */
async function getSkillGroupServiceCapability(request: GetSkillGroupServiceCapabilityRequest): GetSkillGroupServiceCapabilityResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupServiceCapabilityWithOptions(request, runtime);
}

model GetSkillGroupServiceStatusRequest {
  agentIds?: [ long ](name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='false'),
  existChannelInstanceGrouping?: boolean(name='ExistChannelInstanceGrouping', example='false'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='false'),
  existRobotInstanceGrouping?: boolean(name='ExistRobotInstanceGrouping', example='false'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='false'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='10'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetSkillGroupServiceStatusShrinkRequest {
  agentIdsShrink?: string(name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='false'),
  existChannelInstanceGrouping?: boolean(name='ExistChannelInstanceGrouping', example='false'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='false'),
  existRobotInstanceGrouping?: boolean(name='ExistRobotInstanceGrouping', example='false'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='false'),
  groupIdsShrink?: string(name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='10'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetSkillGroupServiceStatusResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: int32(name='PageNum', example='1'),
    pageSize?: int32(name='PageSize', example='2000'),
    rows?: string(name='Rows'),
    totalNum?: int32(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetSkillGroupServiceStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSkillGroupServiceStatusResponseBody(name='body'),
}

/**
 * @summary 技能组服务状态量
 *
 * @param tmpReq GetSkillGroupServiceStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSkillGroupServiceStatusResponse
 */
async function getSkillGroupServiceStatusWithOptions(tmpReq: GetSkillGroupServiceStatusRequest, runtime: Util.RuntimeOptions): GetSkillGroupServiceStatusResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupServiceStatusShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSkillGroupServiceStatus',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 技能组服务状态量
 *
 * @param request GetSkillGroupServiceStatusRequest
 * @return GetSkillGroupServiceStatusResponse
 */
async function getSkillGroupServiceStatus(request: GetSkillGroupServiceStatusRequest): GetSkillGroupServiceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupServiceStatusWithOptions(request, runtime);
}

model GetSkillGroupStatusTotalRequest {
  agentIds?: [ long ](name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIds?: [ long ](name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='false'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='fasle'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='fasle'),
  groupIds?: [ long ](name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetSkillGroupStatusTotalShrinkRequest {
  agentIdsShrink?: string(name='AgentIds'),
  currentPage?: int32(name='CurrentPage', example='1'),
  depIdsShrink?: string(name='DepIds'),
  endDate?: long(name='EndDate', example='1617761765000'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', example='false'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', example='fasle'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', example='fasle'),
  groupIdsShrink?: string(name='GroupIds'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='20'),
  startDate?: long(name='StartDate', example='1615083365000'),
  timeLatitudeType?: string(name='TimeLatitudeType', example='minute'),
}

model GetSkillGroupStatusTotalResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='2000'),
    rows?: string(name='Rows'),
    totalNum?: long(name='TotalNum', example='4'),
  }(name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: string(name='Success', example='true'),
}

model GetSkillGroupStatusTotalResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSkillGroupStatusTotalResponseBody(name='body'),
}

/**
 * @summary 技能组状态总量
 *
 * @param tmpReq GetSkillGroupStatusTotalRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSkillGroupStatusTotalResponse
 */
async function getSkillGroupStatusTotalWithOptions(tmpReq: GetSkillGroupStatusTotalRequest, runtime: Util.RuntimeOptions): GetSkillGroupStatusTotalResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupStatusTotalShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSkillGroupStatusTotal',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 技能组状态总量
 *
 * @param request GetSkillGroupStatusTotalRequest
 * @return GetSkillGroupStatusTotalResponse
 */
async function getSkillGroupStatusTotal(request: GetSkillGroupStatusTotalRequest): GetSkillGroupStatusTotalResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupStatusTotalWithOptions(request, runtime);
}

model HangUpDoubleCallRequest {
  acid?: string(name='Acid', example='68255155****'),
  instanceId?: string(name='InstanceId', example='ccc_xp_pre-cn-***'),
}

model HangUpDoubleCallResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model HangUpDoubleCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: HangUpDoubleCallResponseBody(name='body'),
}

/**
 * @summary 移动端呼叫挂断
 *
 * @param request HangUpDoubleCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return HangUpDoubleCallResponse
 */
async function hangUpDoubleCallWithOptions(request: HangUpDoubleCallRequest, runtime: Util.RuntimeOptions): HangUpDoubleCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acid)) {
    query['Acid'] = request.acid;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'HangUpDoubleCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 移动端呼叫挂断
 *
 * @param request HangUpDoubleCallRequest
 * @return HangUpDoubleCallResponse
 */
async function hangUpDoubleCall(request: HangUpDoubleCallRequest): HangUpDoubleCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return hangUpDoubleCallWithOptions(request, runtime);
}

model HangupCallRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  callId?: string(name='CallId', example='7719786'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  connectionId?: string(name='ConnectionId', example='7719788'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  jobId?: string(name='JobId', example='7719787'),
}

model HangupCallResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model HangupCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: HangupCallResponseBody(name='body'),
}

/**
 * @param request HangupCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return HangupCallResponse
 */
async function hangupCallWithOptions(request: HangupCallRequest, runtime: Util.RuntimeOptions): HangupCallResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.callId)) {
    body['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionId)) {
    body['ConnectionId'] = request.connectionId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'HangupCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request HangupCallRequest
 * @return HangupCallResponse
 */
async function hangupCall(request: HangupCallRequest): HangupCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return hangupCallWithOptions(request, runtime);
}

model HangupOperateRequest {
  callId?: string(name='CallId', description='This parameter is required.', example='147776727911^134522727911'),
  immediateHangup?: boolean(name='ImmediateHangup', example='true'),
}

model HangupOperateResponseBody = {
  code?: string(name='Code', example='OK'),
  mesage?: string(name='Mesage', example='OK'),
  requestId?: string(name='RequestId', example='EFD543DD-E087-54A2-AC0B-54E0656511D7'),
  result?: boolean(name='Result', example='true'),
}

model HangupOperateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: HangupOperateResponseBody(name='body'),
}

/**
 * @summary 通信智能引擎中主动挂断通话
 *
 * @param request HangupOperateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return HangupOperateResponse
 */
async function hangupOperateWithOptions(request: HangupOperateRequest, runtime: Util.RuntimeOptions): HangupOperateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.immediateHangup)) {
    query['ImmediateHangup'] = request.immediateHangup;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'HangupOperate',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 通信智能引擎中主动挂断通话
 *
 * @param request HangupOperateRequest
 * @return HangupOperateResponse
 */
async function hangupOperate(request: HangupOperateRequest): HangupOperateResponse {
  var runtime = new Util.RuntimeOptions{};
  return hangupOperateWithOptions(request, runtime);
}

model HangupThirdCallRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  callId?: string(name='CallId', example='7719786'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  connectionId?: string(name='ConnectionId', example='7719788'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  jobId?: string(name='JobId', example='7719787'),
}

model HangupThirdCallResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model HangupThirdCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: HangupThirdCallResponseBody(name='body'),
}

/**
 * @param request HangupThirdCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return HangupThirdCallResponse
 */
async function hangupThirdCallWithOptions(request: HangupThirdCallRequest, runtime: Util.RuntimeOptions): HangupThirdCallResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.callId)) {
    body['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionId)) {
    body['ConnectionId'] = request.connectionId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'HangupThirdCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request HangupThirdCallRequest
 * @return HangupThirdCallResponse
 */
async function hangupThirdCall(request: HangupThirdCallRequest): HangupThirdCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return hangupThirdCallWithOptions(request, runtime);
}

model HoldCallRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  callId?: string(name='CallId', example='7719786'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  connectionId?: string(name='ConnectionId', example='7719788'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  jobId?: string(name='JobId', example='7719787'),
}

model HoldCallResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model HoldCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: HoldCallResponseBody(name='body'),
}

/**
 * @param request HoldCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return HoldCallResponse
 */
async function holdCallWithOptions(request: HoldCallRequest, runtime: Util.RuntimeOptions): HoldCallResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.callId)) {
    body['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionId)) {
    body['ConnectionId'] = request.connectionId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'HoldCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request HoldCallRequest
 * @return HoldCallResponse
 */
async function holdCall(request: HoldCallRequest): HoldCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return holdCallWithOptions(request, runtime);
}

model HotlineSessionQueryRequest {
  acid?: string(name='Acid', example='7719786****'),
  acidList?: [ string ](name='AcidList'),
  callResult?: string(name='CallResult', example='normal'),
  callResultList?: [ string ](name='CallResultList'),
  callType?: int32(name='CallType', example='1'),
  callTypeList?: [ int32 ](name='CallTypeList'),
  calledNumber?: string(name='CalledNumber', example='135615****'),
  calledNumberList?: [ string ](name='CalledNumberList'),
  callingNumber?: string(name='CallingNumber', example='057177****'),
  callingNumberList?: [ string ](name='CallingNumberList'),
  groupId?: long(name='GroupId', example='123456'),
  groupIdList?: [ long ](name='GroupIdList'),
  groupName?: string(name='GroupName'),
  id?: string(name='Id', example='acc1c58dab4a4dd280e3813c66'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  memberId?: string(name='MemberId', example='7856****'),
  memberIdList?: [ string ](name='MemberIdList'),
  memberName?: string(name='MemberName'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  params?: string(name='Params', example='xxxx'),
  queryEndTime?: long(name='QueryEndTime', example='161482972'),
  queryStartTime?: long(name='QueryStartTime', example='161482872'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  servicerId?: string(name='ServicerId', example='555555'),
  servicerIdList?: [ string ](name='ServicerIdList'),
  servicerName?: string(name='ServicerName'),
}

model HotlineSessionQueryResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: {
    callDetailRecord?: [ 
      {
        acid?: string(name='Acid', example='7719786'),
        activeTransferId?: string(name='ActiveTransferId', example='12'),
        callContinueTime?: int32(name='CallContinueTime', example='37'),
        callResult?: string(name='CallResult', example='normal'),
        callType?: int32(name='CallType', example='1'),
        calledNumber?: string(name='CalledNumber', example='135615*****'),
        callingNumber?: string(name='CallingNumber', example='0571773'),
        createTime?: string(name='CreateTime', example='2020-10-02 22:32:55'),
        evaluationLevel?: int32(name='EvaluationLevel', example='4'),
        evaluationScore?: int32(name='EvaluationScore', example='4'),
        groupId?: long(name='GroupId', example='123456'),
        groupName?: string(name='GroupName'),
        hangUpRole?: string(name='HangUpRole', example='2'),
        hangUpTime?: string(name='HangUpTime', example='2020-10-02 22:33:46'),
        id?: string(name='Id', example='acc1c58dab4a4dd280e3813c66'),
        inQueueTime?: string(name='InQueueTime', example='2020-10-02 22:32:55'),
        memberId?: string(name='MemberId', example='7856876'),
        memberName?: string(name='MemberName'),
        outQueueTime?: string(name='OutQueueTime', example='2020-10-02 22:32:59'),
        passiveTransferId?: string(name='PassiveTransferId', example='12'),
        passiveTransferIdType?: string(name='PassiveTransferIdType', example='1'),
        pickUpTime?: string(name='PickUpTime', example='2020-10-02 22:33:09'),
        queueUpContinueTime?: int32(name='QueueUpContinueTime', example='4'),
        ringContinueTime?: int32(name='RingContinueTime', example='10'),
        ringEndTime?: string(name='RingEndTime', example='2020-10-02 22:33:09'),
        ringStartTime?: string(name='RingStartTime', example='2020-10-02 22:32:59'),
        servicerId?: string(name='ServicerId', example='555555'),
        servicerName?: string(name='ServicerName'),
        trunkCall?: string(name='TrunkCall', example='1861111****'),
      }
    ](name='CallDetailRecord'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='26'),
  }(name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE339D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model HotlineSessionQueryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: HotlineSessionQueryResponseBody(name='body'),
}

/**
 * @param request HotlineSessionQueryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return HotlineSessionQueryResponse
 */
async function hotlineSessionQueryWithOptions(request: HotlineSessionQueryRequest, runtime: Util.RuntimeOptions): HotlineSessionQueryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acid)) {
    query['Acid'] = request.acid;
  }
  if (!Util.isUnset(request.acidList)) {
    query['AcidList'] = request.acidList;
  }
  if (!Util.isUnset(request.callResult)) {
    query['CallResult'] = request.callResult;
  }
  if (!Util.isUnset(request.callResultList)) {
    query['CallResultList'] = request.callResultList;
  }
  if (!Util.isUnset(request.callType)) {
    query['CallType'] = request.callType;
  }
  if (!Util.isUnset(request.callTypeList)) {
    query['CallTypeList'] = request.callTypeList;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.calledNumberList)) {
    query['CalledNumberList'] = request.calledNumberList;
  }
  if (!Util.isUnset(request.callingNumber)) {
    query['CallingNumber'] = request.callingNumber;
  }
  if (!Util.isUnset(request.callingNumberList)) {
    query['CallingNumberList'] = request.callingNumberList;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupIdList)) {
    query['GroupIdList'] = request.groupIdList;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.memberId)) {
    query['MemberId'] = request.memberId;
  }
  if (!Util.isUnset(request.memberIdList)) {
    query['MemberIdList'] = request.memberIdList;
  }
  if (!Util.isUnset(request.memberName)) {
    query['MemberName'] = request.memberName;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.params)) {
    query['Params'] = request.params;
  }
  if (!Util.isUnset(request.queryEndTime)) {
    query['QueryEndTime'] = request.queryEndTime;
  }
  if (!Util.isUnset(request.queryStartTime)) {
    query['QueryStartTime'] = request.queryStartTime;
  }
  if (!Util.isUnset(request.requestId)) {
    query['RequestId'] = request.requestId;
  }
  if (!Util.isUnset(request.servicerId)) {
    query['ServicerId'] = request.servicerId;
  }
  if (!Util.isUnset(request.servicerIdList)) {
    query['ServicerIdList'] = request.servicerIdList;
  }
  if (!Util.isUnset(request.servicerName)) {
    query['ServicerName'] = request.servicerName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'HotlineSessionQuery',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request HotlineSessionQueryRequest
 * @return HotlineSessionQueryResponse
 */
async function hotlineSessionQuery(request: HotlineSessionQueryRequest): HotlineSessionQueryResponse {
  var runtime = new Util.RuntimeOptions{};
  return hotlineSessionQueryWithOptions(request, runtime);
}

model InsertAiOutboundPhoneNumsRequest {
  batchVersion?: int32(name='BatchVersion', example='2'),
  details?: [ 
    {
      bizData?: string(name='BizData', example='xxxx'),
      phoneNum?: string(name='PhoneNum', example='150****0000'),
    }
  ](name='Details', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123'),
}

model InsertAiOutboundPhoneNumsShrinkRequest {
  batchVersion?: int32(name='BatchVersion', example='2'),
  detailsShrink?: string(name='Details', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123'),
}

model InsertAiOutboundPhoneNumsResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    failInfo?: [ 
      {
        bizData?: string(name='BizData', example='xxxx'),
        msg?: string(name='Msg', example='号码格式异常'),
        phoneNum?: string(name='PhoneNum', example='150****0000'),
      }
    ](name='FailInfo'),
    successCount?: int32(name='SuccessCount', example='7'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model InsertAiOutboundPhoneNumsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InsertAiOutboundPhoneNumsResponseBody(name='body'),
}

/**
 * @summary 智能外呼任务导入号码
 *
 * @param tmpReq InsertAiOutboundPhoneNumsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InsertAiOutboundPhoneNumsResponse
 */
async function insertAiOutboundPhoneNumsWithOptions(tmpReq: InsertAiOutboundPhoneNumsRequest, runtime: Util.RuntimeOptions): InsertAiOutboundPhoneNumsResponse {
  Util.validateModel(tmpReq);
  var request = new InsertAiOutboundPhoneNumsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.details)) {
    request.detailsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.details, 'Details', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.batchVersion)) {
    query['BatchVersion'] = request.batchVersion;
  }
  if (!Util.isUnset(request.detailsShrink)) {
    query['Details'] = request.detailsShrink;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'InsertAiOutboundPhoneNums',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 智能外呼任务导入号码
 *
 * @param request InsertAiOutboundPhoneNumsRequest
 * @return InsertAiOutboundPhoneNumsResponse
 */
async function insertAiOutboundPhoneNums(request: InsertAiOutboundPhoneNumsRequest): InsertAiOutboundPhoneNumsResponse {
  var runtime = new Util.RuntimeOptions{};
  return insertAiOutboundPhoneNumsWithOptions(request, runtime);
}

model InsertTaskDetailRequest {
  callInfos?: string(name='CallInfos', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  outboundTaskId?: long(name='OutboundTaskId', description='This parameter is required.'),
}

model InsertTaskDetailResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model InsertTaskDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InsertTaskDetailResponseBody(name='body'),
}

/**
 * @param request InsertTaskDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InsertTaskDetailResponse
 */
async function insertTaskDetailWithOptions(request: InsertTaskDetailRequest, runtime: Util.RuntimeOptions): InsertTaskDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callInfos)) {
    query['CallInfos'] = request.callInfos;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.outboundTaskId)) {
    query['OutboundTaskId'] = request.outboundTaskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'InsertTaskDetail',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request InsertTaskDetailRequest
 * @return InsertTaskDetailResponse
 */
async function insertTaskDetail(request: InsertTaskDetailRequest): InsertTaskDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return insertTaskDetailWithOptions(request, runtime);
}

model JoinThirdCallRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  callId?: string(name='CallId', example='7719786'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  connectionId?: string(name='ConnectionId', example='7719788'),
  holdConnectionId?: string(name='HoldConnectionId', example='0'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  jobId?: string(name='JobId', example='7719787'),
}

model JoinThirdCallResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model JoinThirdCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: JoinThirdCallResponseBody(name='body'),
}

/**
 * @param request JoinThirdCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return JoinThirdCallResponse
 */
async function joinThirdCallWithOptions(request: JoinThirdCallRequest, runtime: Util.RuntimeOptions): JoinThirdCallResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.callId)) {
    body['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionId)) {
    body['ConnectionId'] = request.connectionId;
  }
  if (!Util.isUnset(request.holdConnectionId)) {
    body['HoldConnectionId'] = request.holdConnectionId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'JoinThirdCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request JoinThirdCallRequest
 * @return JoinThirdCallResponse
 */
async function joinThirdCall(request: JoinThirdCallRequest): JoinThirdCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return joinThirdCallWithOptions(request, runtime);
}

model ListAgentBySkillGroupIdRequest {
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  skillGroupId?: long(name='SkillGroupId', description='This parameter is required.', example='666666'),
}

model ListAgentBySkillGroupIdResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: [ 
    {
      accountName?: string(name='AccountName', example='username@example.com'),
      agentId?: long(name='AgentId', example='666666'),
      displayName?: string(name='DisplayName'),
      status?: int32(name='Status', example='0'),
      tenantId?: long(name='TenantId', example='0'),
    }
  ](name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model ListAgentBySkillGroupIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAgentBySkillGroupIdResponseBody(name='body'),
}

/**
 * @param request ListAgentBySkillGroupIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAgentBySkillGroupIdResponse
 */
async function listAgentBySkillGroupIdWithOptions(request: ListAgentBySkillGroupIdRequest, runtime: Util.RuntimeOptions): ListAgentBySkillGroupIdResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAgentBySkillGroupId',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListAgentBySkillGroupIdRequest
 * @return ListAgentBySkillGroupIdResponse
 */
async function listAgentBySkillGroupId(request: ListAgentBySkillGroupIdRequest): ListAgentBySkillGroupIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAgentBySkillGroupIdWithOptions(request, runtime);
}

model ListAiccsRobotRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  robotName?: string(name='RobotName'),
}

model ListAiccsRobotResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      atProfession?: string(name='AtProfession'),
      atSence?: string(name='AtSence'),
      id?: long(name='Id', example='123456'),
      robotName?: string(name='RobotName'),
      robotType?: string(name='RobotType', example='CUSTOM'),
    }
  ](name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model ListAiccsRobotResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAiccsRobotResponseBody(name='body'),
}

/**
 * @summary 查询所有机器人列表
 *
 * @param request ListAiccsRobotRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAiccsRobotResponse
 */
async function listAiccsRobotWithOptions(request: ListAiccsRobotRequest, runtime: Util.RuntimeOptions): ListAiccsRobotResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.robotName)) {
    query['RobotName'] = request.robotName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAiccsRobot',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询所有机器人列表
 *
 * @param request ListAiccsRobotRequest
 * @return ListAiccsRobotResponse
 */
async function listAiccsRobot(request: ListAiccsRobotRequest): ListAiccsRobotResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAiccsRobotWithOptions(request, runtime);
}

model ListChatRecordDetailRequest {
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  closeTimeEnd?: long(name='CloseTimeEnd', example='1614582000000'),
  closeTimeStart?: long(name='CloseTimeStart', example='1614578400000'),
  currentPage?: int32(name='CurrentPage', example='1'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre***'),
  pageSize?: int32(name='PageSize', example='100'),
}

model ListChatRecordDetailResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  resultData?: {
    currentPage?: long(name='CurrentPage', example='1'),
    data?: [ 
      {
        endTime?: long(name='EndTime', example='1614578410000'),
        messageList?: [ 
          {
            content?: string(name='Content'),
            createTime?: long(name='CreateTime', example='1614578400000'),
            msgType?: string(name='MsgType', example='MSG'),
            senderName?: string(name='SenderName', example='account1'),
            senderType?: long(name='SenderType', example='2'),
          }
        ](name='MessageList'),
        servicerName?: string(name='ServicerName', example='123@123.com'),
        startTime?: long(name='StartTime', example='1614578400000'),
      }
    ](name='Data'),
    onePageSize?: long(name='OnePageSize', example='10'),
    totalPage?: long(name='TotalPage', example='10'),
    totalResults?: long(name='TotalResults', example='100'),
  }(name='ResultData'),
  success?: boolean(name='Success', example='true'),
}

model ListChatRecordDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListChatRecordDetailResponseBody(name='body'),
}

/**
 * @summary 根据时间段查询在线会话详情，包含会话内容，时间段范围最长不超过1天
 *
 * @param request ListChatRecordDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListChatRecordDetailResponse
 */
async function listChatRecordDetailWithOptions(request: ListChatRecordDetailRequest, runtime: Util.RuntimeOptions): ListChatRecordDetailResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListChatRecordDetail',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据时间段查询在线会话详情，包含会话内容，时间段范围最长不超过1天
 *
 * @param request ListChatRecordDetailRequest
 * @return ListChatRecordDetailResponse
 */
async function listChatRecordDetail(request: ListChatRecordDetailRequest): ListChatRecordDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return listChatRecordDetailWithOptions(request, runtime);
}

model ListDialogRequest {
  called?: string(name='Called', description='This parameter is required.', example='130****0000'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model ListDialogResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      content?: string(name='Content'),
      nodeType?: string(name='NodeType', example='normal'),
      role?: string(name='Role', example='robot'),
      tag?: string(name='Tag'),
      time?: string(name='Time', example='1619763900718'),
    }
  ](name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model ListDialogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDialogResponseBody(name='body'),
}

/**
 * @summary 查看对话记录
 *
 * @param request ListDialogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDialogResponse
 */
async function listDialogWithOptions(request: ListDialogRequest, runtime: Util.RuntimeOptions): ListDialogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.called)) {
    query['Called'] = request.called;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDialog',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查看对话记录
 *
 * @param request ListDialogRequest
 * @return ListDialogResponse
 */
async function listDialog(request: ListDialogRequest): ListDialogResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDialogWithOptions(request, runtime);
}

model ListHotlineRecordRequest {
  callId?: string(name='CallId', description='This parameter is required.', example='100365558'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model ListHotlineRecordResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: [ 
    {
      callId?: string(name='CallId', example='100365558'),
      connectionId?: string(name='ConnectionId', example='100365548'),
      endTime?: long(name='EndTime', example='16128694810'),
      startTime?: long(name='StartTime', example='16128694110'),
      url?: string(name='Url', example='http://aliccrec-shvpc.oss-cn-shanghai.aliyuncs.com'),
    }
  ](name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model ListHotlineRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHotlineRecordResponseBody(name='body'),
}

/**
 * @param request ListHotlineRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHotlineRecordResponse
 */
async function listHotlineRecordWithOptions(request: ListHotlineRecordRequest, runtime: Util.RuntimeOptions): ListHotlineRecordResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListHotlineRecord',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListHotlineRecordRequest
 * @return ListHotlineRecordResponse
 */
async function listHotlineRecord(request: ListHotlineRecordRequest): ListHotlineRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return listHotlineRecordWithOptions(request, runtime);
}

model ListHotlineRecordDetailRequest {
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  closeTimeEnd?: long(name='CloseTimeEnd', example='1614582000000'),
  closeTimeStart?: long(name='CloseTimeStart', example='1614578400000'),
  currentPage?: int32(name='CurrentPage', example='1'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre***'),
  pageSize?: int32(name='PageSize', example='100'),
}

model ListHotlineRecordDetailResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  resultData?: {
    currentPage?: long(name='CurrentPage', example='1'),
    data?: [ 
      {
        endTime?: long(name='EndTime', example='1614578410000'),
        ossUrl?: string(name='OssUrl', example='http://xxx.xxxxx/xx.wav'),
        servicerName?: string(name='ServicerName', example='123@123.com'),
        startTime?: long(name='StartTime', example='1614578400000'),
      }
    ](name='Data'),
    onePageSize?: long(name='OnePageSize', example='100'),
    totalPage?: long(name='TotalPage', example='10'),
    totalResults?: long(name='TotalResults', example='945'),
  }(name='ResultData'),
  success?: boolean(name='Success', example='true'),
}

model ListHotlineRecordDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHotlineRecordDetailResponseBody(name='body'),
}

/**
 * @summary 根据时间段查询热线详情列表，包含热线通话信息，时间段范围最长不超过1天
 *
 * @param request ListHotlineRecordDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHotlineRecordDetailResponse
 */
async function listHotlineRecordDetailWithOptions(request: ListHotlineRecordDetailRequest, runtime: Util.RuntimeOptions): ListHotlineRecordDetailResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListHotlineRecordDetail',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据时间段查询热线详情列表，包含热线通话信息，时间段范围最长不超过1天
 *
 * @param request ListHotlineRecordDetailRequest
 * @return ListHotlineRecordDetailResponse
 */
async function listHotlineRecordDetail(request: ListHotlineRecordDetailRequest): ListHotlineRecordDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return listHotlineRecordDetailWithOptions(request, runtime);
}

model ListOutboundPhoneNumberRequest {
  accountName?: string(name='AccountName', example='123@****.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model ListOutboundPhoneNumberResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: [ string ](name='Data'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model ListOutboundPhoneNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListOutboundPhoneNumberResponseBody(name='body'),
}

/**
 * @param request ListOutboundPhoneNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListOutboundPhoneNumberResponse
 */
async function listOutboundPhoneNumberWithOptions(request: ListOutboundPhoneNumberRequest, runtime: Util.RuntimeOptions): ListOutboundPhoneNumberResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOutboundPhoneNumber',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListOutboundPhoneNumberRequest
 * @return ListOutboundPhoneNumberResponse
 */
async function listOutboundPhoneNumber(request: ListOutboundPhoneNumberRequest): ListOutboundPhoneNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOutboundPhoneNumberWithOptions(request, runtime);
}

model ListRobotCallDialogRequest {
  callId?: string(name='CallId', description='This parameter is required.', example='125165515022^11195613****'),
  createTime?: string(name='CreateTime', description='This parameter is required.', example='2021-05-20 00:00:00'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ListRobotCallDialogResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: [ 
    {
      content?: string(name='Content'),
      nodeType?: string(name='NodeType', example='normal'),
      role?: string(name='Role', example='robot'),
      tag?: string(name='Tag'),
      time?: string(name='Time', example='1621483557000'),
    }
  ](name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model ListRobotCallDialogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRobotCallDialogResponseBody(name='body'),
}

/**
 * @summary 查看对话记录
 *
 * @param request ListRobotCallDialogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRobotCallDialogResponse
 */
async function listRobotCallDialogWithOptions(request: ListRobotCallDialogRequest, runtime: Util.RuntimeOptions): ListRobotCallDialogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.createTime)) {
    query['CreateTime'] = request.createTime;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRobotCallDialog',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查看对话记录
 *
 * @param request ListRobotCallDialogRequest
 * @return ListRobotCallDialogResponse
 */
async function listRobotCallDialog(request: ListRobotCallDialogRequest): ListRobotCallDialogResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRobotCallDialogWithOptions(request, runtime);
}

model ListRobotNodeRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  robotId?: long(name='RobotId', description='This parameter is required.', example='100002674****'),
}

model ListRobotNodeResponseBody = {
  code?: string(name='Code', example='Ok'),
  data?: [ 
    {
      isOutput?: int32(name='IsOutput', example='1'),
      modelName?: string(name='ModelName'),
      nodeIdentifier?: string(name='NodeIdentifier', example='123456'),
      nodeName?: string(name='NodeName'),
      processName?: string(name='ProcessName'),
    }
  ](name='Data'),
  message?: string(name='Message', example='Ok'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model ListRobotNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRobotNodeResponseBody(name='body'),
}

/**
 * @summary 查询机器人输出列表
 *
 * @param request ListRobotNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRobotNodeResponse
 */
async function listRobotNodeWithOptions(request: ListRobotNodeRequest, runtime: Util.RuntimeOptions): ListRobotNodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.robotId)) {
    query['RobotId'] = request.robotId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRobotNode',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询机器人输出列表
 *
 * @param request ListRobotNodeRequest
 * @return ListRobotNodeResponse
 */
async function listRobotNode(request: ListRobotNodeRequest): ListRobotNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRobotNodeWithOptions(request, runtime);
}

model ListRobotParamsRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  robotId?: long(name='RobotId', description='This parameter is required.', example='123456'),
}

model ListRobotParamsResponseBody = {
  code?: string(name='Code', example='200'),
  data?: [ 
    {
      isEmpty?: int32(name='IsEmpty', example='0'),
      paramCode?: string(name='ParamCode', example='name'),
      paramName?: string(name='ParamName'),
    }
  ](name='Data'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='FF67D4D5-4E90-1DF5-BB8F-060BBFAD72DB'),
  success?: boolean(name='Success', example='true'),
}

model ListRobotParamsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRobotParamsResponseBody(name='body'),
}

/**
 * @summary 查询参数列表
 *
 * @param request ListRobotParamsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRobotParamsResponse
 */
async function listRobotParamsWithOptions(request: ListRobotParamsRequest, runtime: Util.RuntimeOptions): ListRobotParamsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.robotId)) {
    query['RobotId'] = request.robotId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRobotParams',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询参数列表
 *
 * @param request ListRobotParamsRequest
 * @return ListRobotParamsResponse
 */
async function listRobotParams(request: ListRobotParamsRequest): ListRobotParamsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRobotParamsWithOptions(request, runtime);
}

model ListRolesRequest {
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model ListRolesResponseBody = {
  data?: [ 
    {
      buId?: long(name='BuId', example='1'),
      code?: string(name='Code', example='admin'),
      createTime?: string(name='CreateTime', example='2020-01-03T20:25:33Z'),
      description?: string(name='Description', example='Admin'),
      roleGroupId?: long(name='RoleGroupId', example='0'),
      roleGroupName?: string(name='RoleGroupName'),
      roleId?: long(name='RoleId', example='1'),
      title?: string(name='Title'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model ListRolesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRolesResponseBody(name='body'),
}

/**
 * @summary 获取租户下的所有角色
 *
 * @param request ListRolesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRolesResponse
 */
async function listRolesWithOptions(request: ListRolesRequest, runtime: Util.RuntimeOptions): ListRolesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRoles',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取租户下的所有角色
 *
 * @param request ListRolesRequest
 * @return ListRolesResponse
 */
async function listRoles(request: ListRolesRequest): ListRolesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRolesWithOptions(request, runtime);
}

model ListSkillGroupRequest {
  channelType?: int32(name='ChannelType', example='2'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model ListSkillGroupResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: [ 
    {
      channelType?: int32(name='ChannelType', example='2'),
      description?: string(name='Description'),
      displayName?: string(name='DisplayName'),
      name?: string(name='Name'),
      skillGroupId?: long(name='SkillGroupId', example='123456'),
    }
  ](name='Data'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model ListSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSkillGroupResponseBody(name='body'),
}

/**
 * @param request ListSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSkillGroupResponse
 */
async function listSkillGroupWithOptions(request: ListSkillGroupRequest, runtime: Util.RuntimeOptions): ListSkillGroupResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSkillGroup',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListSkillGroupRequest
 * @return ListSkillGroupResponse
 */
async function listSkillGroup(request: ListSkillGroupRequest): ListSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSkillGroupWithOptions(request, runtime);
}

model ListTaskRequest {
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  robotName?: string(name='RobotName'),
  status?: string(name='Status', example='STOP'),
  taskId?: long(name='TaskId'),
  taskName?: string(name='TaskName'),
}

model ListTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    pageNo?: long(name='PageNo', example='1'),
    pageSize?: long(name='PageSize', example='20'),
    record?: [ 
      {
        completeCount?: int32(name='CompleteCount', example='1'),
        fireTime?: string(name='FireTime', example='1618477232000'),
        gmtCreate?: string(name='GmtCreate', example='1618477232000'),
        id?: long(name='Id', example='123456'),
        robotId?: long(name='RobotId', example='123456'),
        robotName?: string(name='RobotName'),
        status?: string(name='Status', example='RELEASE'),
        taskName?: string(name='TaskName'),
        totalCount?: int32(name='TotalCount', example='1'),
      }
    ](name='Record'),
    total?: long(name='Total', example='50'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model ListTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTaskResponseBody(name='body'),
}

/**
 * @summary 查询任务列表
 *
 * @param request ListTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTaskResponse
 */
async function listTaskWithOptions(request: ListTaskRequest, runtime: Util.RuntimeOptions): ListTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.robotName)) {
    query['RobotName'] = request.robotName;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询任务列表
 *
 * @param request ListTaskRequest
 * @return ListTaskResponse
 */
async function listTask(request: ListTaskRequest): ListTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTaskWithOptions(request, runtime);
}

model ListTaskDetailRequest {
  called?: string(name='Called', example='186****0000'),
  id?: long(name='Id', example='123456'),
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: string(name='Status', example='SUCCESS'),
  statusCode?: string(name='StatusCode', example='000001'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model ListTaskDetailResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: {
    pageNo?: long(name='PageNo', example='20'),
    pageSize?: long(name='PageSize', example='1'),
    record?: [ 
      {
        called?: string(name='Called', example='186****0000'),
        caller?: string(name='Caller', example='136****0000'),
        direction?: string(name='Direction'),
        duration?: int32(name='Duration', example='30'),
        endTime?: string(name='EndTime', example='2021-05-20 00:03:00'),
        id?: long(name='Id', example='123456'),
        retryCurTimes?: int32(name='RetryCurTimes', example='1'),
        retryTimes?: int32(name='RetryTimes', example='1'),
        startTime?: string(name='StartTime', example='2021-05-20 00:00:00'),
        status?: string(name='Status', example='SUCCESS'),
        statusCode?: string(name='StatusCode', example='00001'),
        statusCodeDesc?: string(name='StatusCodeDesc'),
        tags?: string(name='Tags'),
      }
    ](name='Record'),
    total?: long(name='Total', example='50'),
  }(name='Data'),
  message?: string(name='Message', example='Ok'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model ListTaskDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTaskDetailResponseBody(name='body'),
}

/**
 * @summary 任务详情查看通话列表
 *
 * @param request ListTaskDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTaskDetailResponse
 */
async function listTaskDetailWithOptions(request: ListTaskDetailRequest, runtime: Util.RuntimeOptions): ListTaskDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.called)) {
    query['Called'] = request.called;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.statusCode)) {
    query['StatusCode'] = request.statusCode;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTaskDetail',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 任务详情查看通话列表
 *
 * @param request ListTaskDetailRequest
 * @return ListTaskDetailResponse
 */
async function listTaskDetail(request: ListTaskDetailRequest): ListTaskDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTaskDetailWithOptions(request, runtime);
}

model LlmSmartCallRequest {
  applicationCode?: string(name='ApplicationCode', description='This parameter is required.', example='F32XXX2CF9'),
  bizParam?: map[string]any(name='BizParam'),
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='137****0000'),
  callerNumber?: string(name='CallerNumber', example='057188040000'),
  outId?: string(name='OutId', example='222356****'),
  promptParam?: map[string]any(name='PromptParam'),
  startWordParam?: map[string]any(name='StartWordParam'),
}

model LlmSmartCallShrinkRequest {
  applicationCode?: string(name='ApplicationCode', description='This parameter is required.', example='F32XXX2CF9'),
  bizParamShrink?: string(name='BizParam'),
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='137****0000'),
  callerNumber?: string(name='CallerNumber', example='057188040000'),
  outId?: string(name='OutId', example='222356****'),
  promptParamShrink?: string(name='PromptParam'),
  startWordParamShrink?: string(name='StartWordParam'),
}

model LlmSmartCallResponseBody = {
  callId?: string(name='CallId', example='125165515***^11195613****'),
  code?: string(name='Code', example='OK'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', description='Id of the request', example='EE338D98-9BD3-XX13-B165'),
}

model LlmSmartCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LlmSmartCallResponseBody(name='body'),
}

/**
 * @summary 基于大模型的智能外呼
 *
 * @param tmpReq LlmSmartCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LlmSmartCallResponse
 */
async function llmSmartCallWithOptions(tmpReq: LlmSmartCallRequest, runtime: Util.RuntimeOptions): LlmSmartCallResponse {
  Util.validateModel(tmpReq);
  var request = new LlmSmartCallShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.bizParam)) {
    request.bizParamShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.bizParam, 'BizParam', 'json');
  }
  if (!Util.isUnset(tmpReq.promptParam)) {
    request.promptParamShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.promptParam, 'PromptParam', 'json');
  }
  if (!Util.isUnset(tmpReq.startWordParam)) {
    request.startWordParamShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.startWordParam, 'StartWordParam', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.applicationCode)) {
    query['ApplicationCode'] = request.applicationCode;
  }
  if (!Util.isUnset(request.bizParamShrink)) {
    query['BizParam'] = request.bizParamShrink;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.callerNumber)) {
    query['CallerNumber'] = request.callerNumber;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.promptParamShrink)) {
    query['PromptParam'] = request.promptParamShrink;
  }
  if (!Util.isUnset(request.startWordParamShrink)) {
    query['StartWordParam'] = request.startWordParamShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'LlmSmartCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 基于大模型的智能外呼
 *
 * @param request LlmSmartCallRequest
 * @return LlmSmartCallResponse
 */
async function llmSmartCall(request: LlmSmartCallRequest): LlmSmartCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return llmSmartCallWithOptions(request, runtime);
}

model LlmSmartCallEncryptRequest {
  applicationCode?: string(name='ApplicationCode', description='This parameter is required.', example='ADDFA32145'),
  callerNumber?: string(name='CallerNumber', description='This parameter is required.', example='ADDFA32145'),
  encryptCalledNumber?: string(name='EncryptCalledNumber', description='This parameter is required.', example='140432432432243'),
  outId?: string(name='OutId', example='dsadsaasfdsad'),
  ownerId?: long(name='OwnerId'),
  promptParam?: map[string]any(name='PromptParam', example='{}'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startWordParam?: map[string]any(name='StartWordParam'),
}

model LlmSmartCallEncryptShrinkRequest {
  applicationCode?: string(name='ApplicationCode', description='This parameter is required.', example='ADDFA32145'),
  callerNumber?: string(name='CallerNumber', description='This parameter is required.', example='ADDFA32145'),
  encryptCalledNumber?: string(name='EncryptCalledNumber', description='This parameter is required.', example='140432432432243'),
  outId?: string(name='OutId', example='dsadsaasfdsad'),
  ownerId?: long(name='OwnerId'),
  promptParamShrink?: string(name='PromptParam', example='{}'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startWordParamShrink?: string(name='StartWordParam'),
}

model LlmSmartCallEncryptResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='None'),
  code?: string(name='Code', example='ok'),
  data?: {
    callId?: string(name='CallId', example='149922088206^136666368206'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='F92F9749-105E-518F-8B08-CF16EF36A0E2'),
  success?: boolean(name='Success', example='true'),
}

model LlmSmartCallEncryptResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LlmSmartCallEncryptResponseBody(name='body'),
}

/**
 * @summary 大模型外呼加密号码接口
 *
 * @param tmpReq LlmSmartCallEncryptRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LlmSmartCallEncryptResponse
 */
async function llmSmartCallEncryptWithOptions(tmpReq: LlmSmartCallEncryptRequest, runtime: Util.RuntimeOptions): LlmSmartCallEncryptResponse {
  Util.validateModel(tmpReq);
  var request = new LlmSmartCallEncryptShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.promptParam)) {
    request.promptParamShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.promptParam, 'PromptParam', 'json');
  }
  if (!Util.isUnset(tmpReq.startWordParam)) {
    request.startWordParamShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.startWordParam, 'StartWordParam', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.applicationCode)) {
    query['ApplicationCode'] = request.applicationCode;
  }
  if (!Util.isUnset(request.callerNumber)) {
    query['CallerNumber'] = request.callerNumber;
  }
  if (!Util.isUnset(request.encryptCalledNumber)) {
    query['EncryptCalledNumber'] = request.encryptCalledNumber;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.promptParamShrink)) {
    query['PromptParam'] = request.promptParamShrink;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startWordParamShrink)) {
    query['StartWordParam'] = request.startWordParamShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'LlmSmartCallEncrypt',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 大模型外呼加密号码接口
 *
 * @param request LlmSmartCallEncryptRequest
 * @return LlmSmartCallEncryptResponse
 */
async function llmSmartCallEncrypt(request: LlmSmartCallEncryptRequest): LlmSmartCallEncryptResponse {
  var runtime = new Util.RuntimeOptions{};
  return llmSmartCallEncryptWithOptions(request, runtime);
}

model MakeCallRequest {
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='130****0000'),
  callingNumber?: string(name='CallingNumber', description='This parameter is required.', example='0571456****'),
  commandCode?: string(name='CommandCode', description='This parameter is required.', example='outBound_Call'),
  extInfo?: string(name='ExtInfo', example='{"bizId": 23323}'),
  outerAccountId?: string(name='OuterAccountId', description='This parameter is required.', example='123456'),
  outerAccountType?: string(name='OuterAccountType', description='This parameter is required.', example='ALIPAY'),
}

model MakeCallResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='true'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model MakeCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MakeCallResponseBody(name='body'),
}

/**
 * @param request MakeCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MakeCallResponse
 */
async function makeCallWithOptions(request: MakeCallRequest, runtime: Util.RuntimeOptions): MakeCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.callingNumber)) {
    query['CallingNumber'] = request.callingNumber;
  }
  if (!Util.isUnset(request.commandCode)) {
    query['CommandCode'] = request.commandCode;
  }
  if (!Util.isUnset(request.extInfo)) {
    query['ExtInfo'] = request.extInfo;
  }
  if (!Util.isUnset(request.outerAccountId)) {
    query['OuterAccountId'] = request.outerAccountId;
  }
  if (!Util.isUnset(request.outerAccountType)) {
    query['OuterAccountType'] = request.outerAccountType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MakeCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request MakeCallRequest
 * @return MakeCallResponse
 */
async function makeCall(request: MakeCallRequest): MakeCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return makeCallWithOptions(request, runtime);
}

model MakeDoubleCallRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='12345'),
  bizData?: string(name='BizData', example='{"bizId": 123456}'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  memberPhone?: string(name='MemberPhone', description='This parameter is required.', example='1502123****'),
  outboundCallNumber?: string(name='OutboundCallNumber', description='This parameter is required.', example='0571000****'),
  servicerPhone?: string(name='ServicerPhone', example='150****1234'),
}

model MakeDoubleCallResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    acid?: string(name='Acid', example='68255155365620598'),
  }(name='Data'),
  message?: string(name='Message', example='Successful'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model MakeDoubleCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MakeDoubleCallResponseBody(name='body'),
}

/**
 * @summary 移动端发起呼叫
 *
 * @param request MakeDoubleCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MakeDoubleCallResponse
 */
async function makeDoubleCallWithOptions(request: MakeDoubleCallRequest, runtime: Util.RuntimeOptions): MakeDoubleCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.bizData)) {
    query['BizData'] = request.bizData;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.memberPhone)) {
    query['MemberPhone'] = request.memberPhone;
  }
  if (!Util.isUnset(request.outboundCallNumber)) {
    query['OutboundCallNumber'] = request.outboundCallNumber;
  }
  if (!Util.isUnset(request.servicerPhone)) {
    query['ServicerPhone'] = request.servicerPhone;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MakeDoubleCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 移动端发起呼叫
 *
 * @param request MakeDoubleCallRequest
 * @return MakeDoubleCallResponse
 */
async function makeDoubleCall(request: MakeDoubleCallRequest): MakeDoubleCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return makeDoubleCallWithOptions(request, runtime);
}

model QueryHotlineInQueueRequest {
  outerGroupId?: string(name='OuterGroupId', description='This parameter is required.', example='123456'),
  outerGroupType?: string(name='OuterGroupType', description='This parameter is required.', example='mybank'),
}

model QueryHotlineInQueueResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='{"n_online_now":10,"n_idle_now":3,"n_resttype_now":3,"n_acw_now":1}'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model QueryHotlineInQueueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryHotlineInQueueResponseBody(name='body'),
}

/**
 * @param request QueryHotlineInQueueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryHotlineInQueueResponse
 */
async function queryHotlineInQueueWithOptions(request: QueryHotlineInQueueRequest, runtime: Util.RuntimeOptions): QueryHotlineInQueueResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryHotlineInQueue',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryHotlineInQueueRequest
 * @return QueryHotlineInQueueResponse
 */
async function queryHotlineInQueue(request: QueryHotlineInQueueRequest): QueryHotlineInQueueResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryHotlineInQueueWithOptions(request, runtime);
}

model QueryHotlineNumberRequest {
  currentPage?: int32(name='CurrentPage', description='This parameter is required.', example='1'),
  departmentId?: long(name='DepartmentId', example='2256****'),
  groupIds?: [ long ](name='GroupIds'),
  hotlineNumber?: string(name='HotlineNumber', example='0571****2211'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
}

model QueryHotlineNumberShrinkRequest {
  currentPage?: int32(name='CurrentPage', description='This parameter is required.', example='1'),
  departmentId?: long(name='DepartmentId', example='2256****'),
  groupIdsShrink?: string(name='GroupIds'),
  hotlineNumber?: string(name='HotlineNumber', example='0571****2211'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
}

model QueryHotlineNumberResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: {
    currentPage?: long(name='CurrentPage', example='1'),
    hotlineNumList?: [ 
      {
        calloutAllDepartment?: boolean(name='CalloutAllDepartment', example='true'),
        calloutRangeList?: [ 
          {
            departmentId?: long(name='DepartmentId', example='2256****'),
            departmentName?: string(name='DepartmentName'),
            groupDOList?: [ 
              {
                groupId?: long(name='GroupId', example='6083****'),
                groupName?: string(name='GroupName'),
              }
            ](name='GroupDOList'),
          }
        ](name='CalloutRangeList'),
        description?: string(name='Description', example='测试'),
        evaluationStatus?: int32(name='EvaluationStatus', example='0'),
        flowId?: long(name='FlowId', example='12'),
        flowName?: string(name='FlowName', example='测试流程'),
        hotlineNumber?: string(name='HotlineNumber', example='0571****2211'),
        inBoundEnabled?: boolean(name='InBoundEnabled', example='true'),
        location?: string(name='Location', example='浙江杭州'),
        outboundEnabled?: boolean(name='OutboundEnabled', example='true'),
        sp?: string(name='Sp', example='电信'),
      }
    ](name='HotlineNumList'),
    pageSize?: long(name='PageSize', example='10'),
    totalCount?: long(name='TotalCount', example='123'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE339D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model QueryHotlineNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryHotlineNumberResponseBody(name='body'),
}

/**
 * @summary 查询热线号码配置
 *
 * @param tmpReq QueryHotlineNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryHotlineNumberResponse
 */
async function queryHotlineNumberWithOptions(tmpReq: QueryHotlineNumberRequest, runtime: Util.RuntimeOptions): QueryHotlineNumberResponse {
  Util.validateModel(tmpReq);
  var request = new QueryHotlineNumberShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'json');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryHotlineNumber',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询热线号码配置
 *
 * @param request QueryHotlineNumberRequest
 * @return QueryHotlineNumberResponse
 */
async function queryHotlineNumber(request: QueryHotlineNumberRequest): QueryHotlineNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryHotlineNumberWithOptions(request, runtime);
}

model QueryOutboundTaskRequest {
  ani?: string(name='Ani'),
  currentPage?: int32(name='CurrentPage'),
  departmentId?: string(name='DepartmentId'),
  endDate?: string(name='EndDate'),
  endTime?: string(name='EndTime'),
  groupName?: string(name='GroupName'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  pageSize?: int32(name='PageSize'),
  skillGroup?: long(name='SkillGroup'),
  startDate?: string(name='StartDate'),
  startTime?: string(name='StartTime'),
  status?: string(name='Status'),
  taskId?: long(name='TaskId'),
  taskName?: string(name='TaskName'),
  taskType?: int32(name='TaskType'),
}

model QueryOutboundTaskResponseBody = {
  code?: string(name='Code'),
  data?: {
    currentPage?: string(name='CurrentPage'),
    list?: [ 
      {
        buId?: long(name='BuId'),
        callerNum?: string(name='CallerNum'),
        creator?: string(name='Creator'),
        departmentId?: long(name='DepartmentId'),
        description?: string(name='Description'),
        endDate?: string(name='EndDate'),
        endTime?: string(name='EndTime'),
        extAttrs?: string(name='ExtAttrs'),
        gmtCreate?: long(name='GmtCreate'),
        gmtModified?: long(name='GmtModified'),
        groupName?: string(name='GroupName'),
        id?: long(name='Id'),
        model?: int32(name='Model'),
        modifier?: string(name='Modifier'),
        name?: string(name='Name'),
        retryInterval?: int32(name='RetryInterval'),
        retryTime?: int32(name='RetryTime'),
        skillGroup?: long(name='SkillGroup'),
        startDate?: string(name='StartDate'),
        startTime?: string(name='StartTime'),
        status?: int32(name='Status'),
        type?: int32(name='Type'),
      }
    ](name='List'),
    pageSize?: string(name='PageSize'),
    totalResults?: string(name='TotalResults'),
  }(name='Data'),
  httpStatusCode?: string(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model QueryOutboundTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryOutboundTaskResponseBody(name='body'),
}

/**
 * @param request QueryOutboundTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryOutboundTaskResponse
 */
async function queryOutboundTaskWithOptions(request: QueryOutboundTaskRequest, runtime: Util.RuntimeOptions): QueryOutboundTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ani)) {
    query['Ani'] = request.ani;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.skillGroup)) {
    query['SkillGroup'] = request.skillGroup;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryOutboundTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryOutboundTaskRequest
 * @return QueryOutboundTaskResponse
 */
async function queryOutboundTask(request: QueryOutboundTaskRequest): QueryOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryOutboundTaskWithOptions(request, runtime);
}

model QuerySkillGroupsRequest {
  channelType?: int32(name='ChannelType', example='2'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  departmentId?: long(name='DepartmentId', example='1023****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageNo?: int32(name='PageNo', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='20'),
}

model QuerySkillGroupsResponseBody = {
  currentPage?: int32(name='CurrentPage', example='1'),
  data?: [ 
    {
      channelType?: int32(name='ChannelType', example='2'),
      description?: string(name='Description'),
      displayName?: string(name='DisplayName'),
      skillGroupId?: long(name='SkillGroupId', example='123456'),
      skillGroupName?: string(name='SkillGroupName'),
    }
  ](name='Data'),
  onePageSize?: int32(name='OnePageSize', example='20'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  totalPage?: int32(name='TotalPage', example='4'),
  totalResults?: int32(name='TotalResults', example='76'),
}

model QuerySkillGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySkillGroupsResponseBody(name='body'),
}

/**
 * @param request QuerySkillGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QuerySkillGroupsResponse
 */
async function querySkillGroupsWithOptions(request: QuerySkillGroupsRequest, runtime: Util.RuntimeOptions): QuerySkillGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.channelType)) {
    query['ChannelType'] = request.channelType;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QuerySkillGroups',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QuerySkillGroupsRequest
 * @return QuerySkillGroupsResponse
 */
async function querySkillGroups(request: QuerySkillGroupsRequest): QuerySkillGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySkillGroupsWithOptions(request, runtime);
}

model QueryTaskDetailRequest {
  ani?: string(name='Ani'),
  currentPage?: int32(name='CurrentPage'),
  departmentIdList?: string(name='DepartmentIdList'),
  dnis?: string(name='Dnis'),
  endReasonList?: string(name='EndReasonList'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  outboundTaskId?: string(name='OutboundTaskId'),
  pageSize?: int32(name='PageSize'),
  priorityList?: string(name='PriorityList'),
  servicerId?: string(name='ServicerId'),
  servicerName?: string(name='ServicerName'),
  sid?: string(name='Sid'),
  skillGroup?: string(name='SkillGroup'),
  statusList?: string(name='StatusList'),
  taskId?: long(name='TaskId'),
}

model QueryTaskDetailResponseBody = {
  code?: string(name='Code'),
  data?: {
    currentPage?: string(name='CurrentPage'),
    list?: [ 
      {
        ani?: string(name='Ani'),
        buId?: long(name='BuId'),
        departmentId?: long(name='DepartmentId'),
        dnis?: string(name='Dnis'),
        endReason?: int32(name='EndReason'),
        extAttrs?: string(name='ExtAttrs'),
        gmtCreate?: long(name='GmtCreate'),
        gmtModified?: long(name='GmtModified'),
        id?: int32(name='Id'),
        memberId?: long(name='MemberId'),
        memberName?: string(name='MemberName'),
        outboundNum?: int32(name='OutboundNum'),
        outboundTaskId?: long(name='OutboundTaskId'),
        priority?: int32(name='Priority'),
        retryTime?: string(name='RetryTime'),
        servicerId?: long(name='ServicerId'),
        servicerName?: string(name='ServicerName'),
        skillGroup?: int32(name='SkillGroup'),
        status?: int32(name='Status'),
      }
    ](name='List'),
    pageSize?: string(name='PageSize'),
    totalResults?: string(name='TotalResults'),
  }(name='Data'),
  httpStatusCode?: string(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model QueryTaskDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTaskDetailResponseBody(name='body'),
}

/**
 * @param request QueryTaskDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTaskDetailResponse
 */
async function queryTaskDetailWithOptions(request: QueryTaskDetailRequest, runtime: Util.RuntimeOptions): QueryTaskDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ani)) {
    query['Ani'] = request.ani;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.departmentIdList)) {
    query['DepartmentIdList'] = request.departmentIdList;
  }
  if (!Util.isUnset(request.dnis)) {
    query['Dnis'] = request.dnis;
  }
  if (!Util.isUnset(request.endReasonList)) {
    query['EndReasonList'] = request.endReasonList;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.outboundTaskId)) {
    query['OutboundTaskId'] = request.outboundTaskId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.priorityList)) {
    query['PriorityList'] = request.priorityList;
  }
  if (!Util.isUnset(request.servicerId)) {
    query['ServicerId'] = request.servicerId;
  }
  if (!Util.isUnset(request.servicerName)) {
    query['ServicerName'] = request.servicerName;
  }
  if (!Util.isUnset(request.sid)) {
    query['Sid'] = request.sid;
  }
  if (!Util.isUnset(request.skillGroup)) {
    query['SkillGroup'] = request.skillGroup;
  }
  if (!Util.isUnset(request.statusList)) {
    query['StatusList'] = request.statusList;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryTaskDetail',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryTaskDetailRequest
 * @return QueryTaskDetailResponse
 */
async function queryTaskDetail(request: QueryTaskDetailRequest): QueryTaskDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTaskDetailWithOptions(request, runtime);
}

model QueryTicketsRequest {
  caseId?: long(name='CaseId', example='223468****'),
  caseStatus?: int32(name='CaseStatus', example='2'),
  caseType?: int32(name='CaseType', example='1223'),
  channelId?: string(name='ChannelId', example='02acfefd3fa14049826ac1a89e1xxxxx'),
  channelType?: int32(name='ChannelType', example='1'),
  currentPage?: int32(name='CurrentPage', example='1'),
  dealId?: long(name='DealId', example='123456'),
  extra?: map[string]any(name='Extra'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='10'),
  srType?: long(name='SrType', example='29506'),
  taskStatus?: int32(name='TaskStatus', example='3'),
  touchId?: long(name='TouchId', example='15030609'),
}

model QueryTicketsShrinkRequest {
  caseId?: long(name='CaseId', example='223468****'),
  caseStatus?: int32(name='CaseStatus', example='2'),
  caseType?: int32(name='CaseType', example='1223'),
  channelId?: string(name='ChannelId', example='02acfefd3fa14049826ac1a89e1xxxxx'),
  channelType?: int32(name='ChannelType', example='1'),
  currentPage?: int32(name='CurrentPage', example='1'),
  dealId?: long(name='DealId', example='123456'),
  extraShrink?: string(name='Extra'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  pageSize?: int32(name='PageSize', example='10'),
  srType?: long(name='SrType', example='29506'),
  taskStatus?: int32(name='TaskStatus', example='3'),
  touchId?: long(name='TouchId', example='15030609'),
}

model QueryTicketsResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='{ "totalResults":1 "previousPage":1 "data":[ 0:{ "serviceType":1 "lastUrgeTime":0 "queueId":0 "sopCateId":252011 "totalUrgeMemo":"" "taskGmtModified":0 "departmentId":10 "groupId":0 "channelType":1 "questionInfo":"" "templateId":0 "deadLine":0 "srType":30701 "caseId":2000000001165962}'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model QueryTicketsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTicketsResponseBody(name='body'),
}

/**
 * @param tmpReq QueryTicketsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTicketsResponse
 */
async function queryTicketsWithOptions(tmpReq: QueryTicketsRequest, runtime: Util.RuntimeOptions): QueryTicketsResponse {
  Util.validateModel(tmpReq);
  var request = new QueryTicketsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extra)) {
    request.extraShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extra, 'Extra', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.caseId)) {
    body['CaseId'] = request.caseId;
  }
  if (!Util.isUnset(request.caseStatus)) {
    body['CaseStatus'] = request.caseStatus;
  }
  if (!Util.isUnset(request.caseType)) {
    body['CaseType'] = request.caseType;
  }
  if (!Util.isUnset(request.channelId)) {
    body['ChannelId'] = request.channelId;
  }
  if (!Util.isUnset(request.channelType)) {
    body['ChannelType'] = request.channelType;
  }
  if (!Util.isUnset(request.currentPage)) {
    body['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.dealId)) {
    body['DealId'] = request.dealId;
  }
  if (!Util.isUnset(request.extraShrink)) {
    body['Extra'] = request.extraShrink;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.srType)) {
    body['SrType'] = request.srType;
  }
  if (!Util.isUnset(request.taskStatus)) {
    body['TaskStatus'] = request.taskStatus;
  }
  if (!Util.isUnset(request.touchId)) {
    body['TouchId'] = request.touchId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryTickets',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryTicketsRequest
 * @return QueryTicketsResponse
 */
async function queryTickets(request: QueryTicketsRequest): QueryTicketsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTicketsWithOptions(request, runtime);
}

model QueryTouchListRequest {
  channelId?: [ string ](name='ChannelId'),
  channelType?: [ int32 ](name='ChannelType'),
  closeTimeEnd?: long(name='CloseTimeEnd', example='1614600500000'),
  closeTimeStart?: long(name='CloseTimeStart', example='1614600400000'),
  currentPage?: int32(name='CurrentPage', example='1'),
  evaluationLevel?: [ int32 ](name='EvaluationLevel'),
  evaluationScore?: [ int32 ](name='EvaluationScore'),
  evaluationStatus?: [ int32 ](name='EvaluationStatus'),
  firstTimeEnd?: long(name='FirstTimeEnd', example='1614599400000'),
  firstTimeStart?: long(name='FirstTimeStart', example='1614596400000'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  memberId?: [ long ](name='MemberId'),
  memberName?: [ string ](name='MemberName'),
  pageSize?: int32(name='PageSize', example='20'),
  queueId?: [ long ](name='QueueId'),
  servicerId?: [ long ](name='ServicerId'),
  servicerName?: [ string ](name='ServicerName'),
  touchId?: [ long ](name='TouchId'),
  touchType?: [ int32 ](name='TouchType'),
}

model QueryTouchListResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='Success'),
  requestId?: string(name='RequestId', example='865658FD-80DE-5D49-ABEB-F3CC9863F4F1'),
  resultData?: {
    currentPage?: int32(name='CurrentPage', example='1'),
    data?: [ 
      {
        buId?: long(name='BuId', example='905'),
        channelId?: string(name='ChannelId', example='4f8807a9de024507a3090b5b66a8****'),
        channelType?: int32(name='ChannelType', example='1'),
        closeTime?: long(name='CloseTime', example='1611207976000'),
        commonQueueName?: string(name='CommonQueueName'),
        depId?: long(name='DepId', example='100'),
        extAttrs?: {
          ani?: string(name='Ani', example='187****0000'),
          dnis?: string(name='Dnis', example='05712688****'),
          evaluationLevel?: int32(name='EvaluationLevel', example='2'),
          evaluationScore?: int32(name='EvaluationScore', example='1'),
          evaluationSolution?: int32(name='EvaluationSolution', example='0'),
          evaluationStatus?: int32(name='EvaluationStatus', example='1'),
          onlineJoinRespInterval?: int32(name='OnlineJoinRespInterval', example='1'),
          onlineSessionSource?: int32(name='OnlineSessionSource', example='0'),
          outCallRouteNumber?: string(name='OutCallRouteNumber', example='05712688****'),
        }(name='ExtAttrs'),
        extAttrsString?: map[string]any(name='ExtAttrsString'),
        feedback?: string(name='Feedback', example='xxxx'),
        firstTime?: long(name='FirstTime', example='1611209971000'),
        fromId?: long(name='FromId', example='6400665****'),
        gmtCreate?: long(name='GmtCreate', example='1611209971000'),
        gmtModified?: long(name='GmtModified', example='1611207979000'),
        memberId?: long(name='MemberId', example='6400665****'),
        memberName?: string(name='MemberName'),
        parentTouchId?: long(name='ParentTouchId', example='0'),
        queueId?: long(name='QueueId', example='111'),
        servicerId?: long(name='ServicerId', example='67****'),
        servicerName?: string(name='ServicerName', example='13900001234'),
        status?: int32(name='Status', example='1'),
        switchUser?: string(name='SwitchUser', example='null'),
        toId?: long(name='ToId', example='678026'),
        touchContent?: string(name='TouchContent', example='1'),
        touchEndReason?: int32(name='TouchEndReason', example='2'),
        touchId?: string(name='TouchId', example='1386****'),
        touchTime?: string(name='TouchTime', example='111'),
        touchType?: int32(name='TouchType', example='2'),
        userTouchId?: long(name='UserTouchId', example='1386****'),
      }
    ](name='Data'),
    empty?: boolean(name='Empty', example='false'),
    nextPage?: int32(name='NextPage', example='2'),
    onePageSize?: int32(name='OnePageSize', example='2'),
    previousPage?: int32(name='PreviousPage', example='2'),
    totalPage?: int32(name='TotalPage', example='4'),
    totalResults?: int32(name='TotalResults', example='100'),
  }(name='ResultData'),
  success?: boolean(name='Success', example='true'),
}

model QueryTouchListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTouchListResponseBody(name='body'),
}

/**
 * @param request QueryTouchListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTouchListResponse
 */
async function queryTouchListWithOptions(request: QueryTouchListRequest, runtime: Util.RuntimeOptions): QueryTouchListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.channelId)) {
    body['ChannelId'] = request.channelId;
  }
  if (!Util.isUnset(request.channelType)) {
    body['ChannelType'] = request.channelType;
  }
  if (!Util.isUnset(request.closeTimeEnd)) {
    body['CloseTimeEnd'] = request.closeTimeEnd;
  }
  if (!Util.isUnset(request.closeTimeStart)) {
    body['CloseTimeStart'] = request.closeTimeStart;
  }
  if (!Util.isUnset(request.currentPage)) {
    body['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.evaluationLevel)) {
    body['EvaluationLevel'] = request.evaluationLevel;
  }
  if (!Util.isUnset(request.evaluationScore)) {
    body['EvaluationScore'] = request.evaluationScore;
  }
  if (!Util.isUnset(request.evaluationStatus)) {
    body['EvaluationStatus'] = request.evaluationStatus;
  }
  if (!Util.isUnset(request.firstTimeEnd)) {
    body['FirstTimeEnd'] = request.firstTimeEnd;
  }
  if (!Util.isUnset(request.firstTimeStart)) {
    body['FirstTimeStart'] = request.firstTimeStart;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.memberId)) {
    body['MemberId'] = request.memberId;
  }
  if (!Util.isUnset(request.memberName)) {
    body['MemberName'] = request.memberName;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.queueId)) {
    body['QueueId'] = request.queueId;
  }
  if (!Util.isUnset(request.servicerId)) {
    body['ServicerId'] = request.servicerId;
  }
  if (!Util.isUnset(request.servicerName)) {
    body['ServicerName'] = request.servicerName;
  }
  if (!Util.isUnset(request.touchId)) {
    body['TouchId'] = request.touchId;
  }
  if (!Util.isUnset(request.touchType)) {
    body['TouchType'] = request.touchType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryTouchList',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryTouchListRequest
 * @return QueryTouchListResponse
 */
async function queryTouchList(request: QueryTouchListRequest): QueryTouchListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTouchListWithOptions(request, runtime);
}

model RemoveAgentFromSkillGroupRequest {
  agentIds?: [ long ](name='AgentIds', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  skillGroupId?: long(name='SkillGroupId', description='This parameter is required.', example='1146****'),
}

model RemoveAgentFromSkillGroupShrinkRequest {
  agentIdsShrink?: string(name='AgentIds', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  skillGroupId?: long(name='SkillGroupId', description='This parameter is required.', example='1146****'),
}

model RemoveAgentFromSkillGroupResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: {
    successCount?: int32(name='SuccessCount', example='2'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model RemoveAgentFromSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveAgentFromSkillGroupResponseBody(name='body'),
}

/**
 * @summary 从技能组中移除坐席
 *
 * @param tmpReq RemoveAgentFromSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveAgentFromSkillGroupResponse
 */
async function removeAgentFromSkillGroupWithOptions(tmpReq: RemoveAgentFromSkillGroupRequest, runtime: Util.RuntimeOptions): RemoveAgentFromSkillGroupResponse {
  Util.validateModel(tmpReq);
  var request = new RemoveAgentFromSkillGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentIdsShrink)) {
    query['AgentIds'] = request.agentIdsShrink;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveAgentFromSkillGroup',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 从技能组中移除坐席
 *
 * @param request RemoveAgentFromSkillGroupRequest
 * @return RemoveAgentFromSkillGroupResponse
 */
async function removeAgentFromSkillGroup(request: RemoveAgentFromSkillGroupRequest): RemoveAgentFromSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeAgentFromSkillGroupWithOptions(request, runtime);
}

model RemoveSkillGroupRequest {
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  skillGroupId?: string(name='SkillGroupId', description='This parameter is required.', example='123456'),
}

model RemoveSkillGroupResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model RemoveSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveSkillGroupResponseBody(name='body'),
}

/**
 * @param request RemoveSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveSkillGroupResponse
 */
async function removeSkillGroupWithOptions(request: RemoveSkillGroupRequest, runtime: Util.RuntimeOptions): RemoveSkillGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.skillGroupId)) {
    body['SkillGroupId'] = request.skillGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveSkillGroup',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request RemoveSkillGroupRequest
 * @return RemoveSkillGroupResponse
 */
async function removeSkillGroup(request: RemoveSkillGroupRequest): RemoveSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeSkillGroupWithOptions(request, runtime);
}

model ResetHotlineNumberRequest {
  description?: string(name='Description', description='This parameter is required.', example='desc'),
  enableInbound?: boolean(name='EnableInbound', description='This parameter is required.', example='true'),
  enableInboundEvaluation?: boolean(name='EnableInboundEvaluation', description='This parameter is required.', example='true'),
  enableOutbound?: boolean(name='EnableOutbound', description='This parameter is required.', example='true'),
  enableOutboundEvaluation?: boolean(name='EnableOutboundEvaluation', description='This parameter is required.', example='true'),
  evaluationLevel?: int32(name='EvaluationLevel', example='2'),
  hotlineNumber?: string(name='HotlineNumber', description='This parameter is required.', example='0571********'),
  inboundFlowId?: long(name='InboundFlowId', example='123456'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  outboundAllDepart?: boolean(name='OutboundAllDepart', description='This parameter is required.', example='true'),
  outboundRangeList?: [ 
    {
      departmentId?: long(name='DepartmentId', example='123456'),
      groupIdList?: [ long ](name='GroupIdList'),
    }
  ](name='OutboundRangeList'),
}

model ResetHotlineNumberShrinkRequest {
  description?: string(name='Description', description='This parameter is required.', example='desc'),
  enableInbound?: boolean(name='EnableInbound', description='This parameter is required.', example='true'),
  enableInboundEvaluation?: boolean(name='EnableInboundEvaluation', description='This parameter is required.', example='true'),
  enableOutbound?: boolean(name='EnableOutbound', description='This parameter is required.', example='true'),
  enableOutboundEvaluation?: boolean(name='EnableOutboundEvaluation', description='This parameter is required.', example='true'),
  evaluationLevel?: int32(name='EvaluationLevel', example='2'),
  hotlineNumber?: string(name='HotlineNumber', description='This parameter is required.', example='0571********'),
  inboundFlowId?: long(name='InboundFlowId', example='123456'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  outboundAllDepart?: boolean(name='OutboundAllDepart', description='This parameter is required.', example='true'),
  outboundRangeListShrink?: string(name='OutboundRangeList'),
}

model ResetHotlineNumberResponseBody = {
  code?: string(name='Code', example='Success'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='xxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model ResetHotlineNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetHotlineNumberResponseBody(name='body'),
}

/**
 * @summary 重置热线号码
 *
 * @param tmpReq ResetHotlineNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetHotlineNumberResponse
 */
async function resetHotlineNumberWithOptions(tmpReq: ResetHotlineNumberRequest, runtime: Util.RuntimeOptions): ResetHotlineNumberResponse {
  Util.validateModel(tmpReq);
  var request = new ResetHotlineNumberShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.outboundRangeList)) {
    request.outboundRangeListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.outboundRangeList, 'OutboundRangeList', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.enableInbound)) {
    body['EnableInbound'] = request.enableInbound;
  }
  if (!Util.isUnset(request.enableInboundEvaluation)) {
    body['EnableInboundEvaluation'] = request.enableInboundEvaluation;
  }
  if (!Util.isUnset(request.enableOutbound)) {
    body['EnableOutbound'] = request.enableOutbound;
  }
  if (!Util.isUnset(request.enableOutboundEvaluation)) {
    body['EnableOutboundEvaluation'] = request.enableOutboundEvaluation;
  }
  if (!Util.isUnset(request.evaluationLevel)) {
    body['EvaluationLevel'] = request.evaluationLevel;
  }
  if (!Util.isUnset(request.hotlineNumber)) {
    body['HotlineNumber'] = request.hotlineNumber;
  }
  if (!Util.isUnset(request.inboundFlowId)) {
    body['InboundFlowId'] = request.inboundFlowId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.outboundAllDepart)) {
    body['OutboundAllDepart'] = request.outboundAllDepart;
  }
  if (!Util.isUnset(request.outboundRangeListShrink)) {
    body['OutboundRangeList'] = request.outboundRangeListShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ResetHotlineNumber',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 重置热线号码
 *
 * @param request ResetHotlineNumberRequest
 * @return ResetHotlineNumberResponse
 */
async function resetHotlineNumber(request: ResetHotlineNumberRequest): ResetHotlineNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetHotlineNumberWithOptions(request, runtime);
}

model RestartOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  outboundTaskId?: long(name='OutboundTaskId', description='This parameter is required.'),
}

model RestartOutboundTaskResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RestartOutboundTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartOutboundTaskResponseBody(name='body'),
}

/**
 * @param request RestartOutboundTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartOutboundTaskResponse
 */
async function restartOutboundTaskWithOptions(request: RestartOutboundTaskRequest, runtime: Util.RuntimeOptions): RestartOutboundTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.outboundTaskId)) {
    query['OutboundTaskId'] = request.outboundTaskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RestartOutboundTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request RestartOutboundTaskRequest
 * @return RestartOutboundTaskResponse
 */
async function restartOutboundTask(request: RestartOutboundTaskRequest): RestartOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return restartOutboundTaskWithOptions(request, runtime);
}

model RobotCallRequest {
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='131****2204'),
  calledShowNumber?: string(name='CalledShowNumber', description='This parameter is required.', example='0571****5678'),
  earlyMediaAsr?: boolean(name='EarlyMediaAsr', example='false'),
  outId?: string(name='OutId', example='abcdefgh'),
  ownerId?: long(name='OwnerId'),
  params?: string(name='Params'),
  recordFlag?: boolean(name='RecordFlag', example='true'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  robotId?: long(name='RobotId', description='This parameter is required.', example='350000****'),
}

model RobotCallResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='116012854210^10281427*****'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'),
}

model RobotCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RobotCallResponseBody(name='body'),
}

/**
 * @param request RobotCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RobotCallResponse
 */
async function robotCallWithOptions(request: RobotCallRequest, runtime: Util.RuntimeOptions): RobotCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.calledShowNumber)) {
    query['CalledShowNumber'] = request.calledShowNumber;
  }
  if (!Util.isUnset(request.earlyMediaAsr)) {
    query['EarlyMediaAsr'] = request.earlyMediaAsr;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.params)) {
    query['Params'] = request.params;
  }
  if (!Util.isUnset(request.recordFlag)) {
    query['RecordFlag'] = request.recordFlag;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.robotId)) {
    query['RobotId'] = request.robotId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RobotCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request RobotCallRequest
 * @return RobotCallResponse
 */
async function robotCall(request: RobotCallRequest): RobotCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return robotCallWithOptions(request, runtime);
}

model SendCcoSmartCallRequest {
  actionCodeBreak?: boolean(name='ActionCodeBreak', example='true'),
  actionCodeTimeBreak?: int32(name='ActionCodeTimeBreak', example='120'),
  asrAlsAmId?: string(name='AsrAlsAmId', example='123456'),
  asrBaseId?: string(name='AsrBaseId', example='customer_service_8k'),
  asrModelId?: string(name='AsrModelId', example='bf71664d30d2478fb8cb8c39c6b6****'),
  asrVocabularyId?: string(name='AsrVocabularyId', example='123456'),
  backgroundFileCode?: string(name='BackgroundFileCode', example='2d4c-4e78-8d2a-afbb06cf****.wav'),
  backgroundSpeed?: int32(name='BackgroundSpeed', example='1'),
  backgroundVolume?: int32(name='BackgroundVolume', example='1'),
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='137****0000'),
  calledShowNumber?: string(name='CalledShowNumber', description='This parameter is required.', example='0571****0000'),
  dynamicId?: string(name='DynamicId', example='123456'),
  earlyMediaAsr?: boolean(name='EarlyMediaAsr', example='fasle'),
  enableITN?: boolean(name='EnableITN', example='true'),
  muteTime?: int32(name='MuteTime', example='10000'),
  outId?: string(name='OutId', example='222356****'),
  ownerId?: long(name='OwnerId'),
  pauseTime?: int32(name='PauseTime', example='800'),
  playTimes?: int32(name='PlayTimes', example='1'),
  prodCode?: string(name='ProdCode', example='aiccs'),
  recordFlag?: boolean(name='RecordFlag', example='true'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sessionTimeout?: int32(name='SessionTimeout', example='120'),
  speed?: int32(name='Speed', example='1'),
  ttsConf?: boolean(name='TtsConf', example='true'),
  ttsSpeed?: int32(name='TtsSpeed', example='100'),
  ttsStyle?: string(name='TtsStyle', example='xiaoyun'),
  ttsVolume?: int32(name='TtsVolume', example='10'),
  voiceCode?: string(name='VoiceCode', description='This parameter is required.', example='2d4c-4e78-8d2a-afbb06cf****.wav,$name$'),
  voiceCodeParam?: string(name='VoiceCodeParam'),
  volume?: int32(name='Volume', example='1'),
}

model SendCcoSmartCallResponseBody = {
  code?: string(name='Code', example='16012854210^10281427****'),
  data?: string(name='Data', example='OK'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'),
}

model SendCcoSmartCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendCcoSmartCallResponseBody(name='body'),
}

/**
 * @param request SendCcoSmartCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SendCcoSmartCallResponse
 */
async function sendCcoSmartCallWithOptions(request: SendCcoSmartCallRequest, runtime: Util.RuntimeOptions): SendCcoSmartCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.actionCodeBreak)) {
    query['ActionCodeBreak'] = request.actionCodeBreak;
  }
  if (!Util.isUnset(request.actionCodeTimeBreak)) {
    query['ActionCodeTimeBreak'] = request.actionCodeTimeBreak;
  }
  if (!Util.isUnset(request.asrAlsAmId)) {
    query['AsrAlsAmId'] = request.asrAlsAmId;
  }
  if (!Util.isUnset(request.asrBaseId)) {
    query['AsrBaseId'] = request.asrBaseId;
  }
  if (!Util.isUnset(request.asrModelId)) {
    query['AsrModelId'] = request.asrModelId;
  }
  if (!Util.isUnset(request.asrVocabularyId)) {
    query['AsrVocabularyId'] = request.asrVocabularyId;
  }
  if (!Util.isUnset(request.backgroundFileCode)) {
    query['BackgroundFileCode'] = request.backgroundFileCode;
  }
  if (!Util.isUnset(request.backgroundSpeed)) {
    query['BackgroundSpeed'] = request.backgroundSpeed;
  }
  if (!Util.isUnset(request.backgroundVolume)) {
    query['BackgroundVolume'] = request.backgroundVolume;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.calledShowNumber)) {
    query['CalledShowNumber'] = request.calledShowNumber;
  }
  if (!Util.isUnset(request.dynamicId)) {
    query['DynamicId'] = request.dynamicId;
  }
  if (!Util.isUnset(request.earlyMediaAsr)) {
    query['EarlyMediaAsr'] = request.earlyMediaAsr;
  }
  if (!Util.isUnset(request.enableITN)) {
    query['EnableITN'] = request.enableITN;
  }
  if (!Util.isUnset(request.muteTime)) {
    query['MuteTime'] = request.muteTime;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pauseTime)) {
    query['PauseTime'] = request.pauseTime;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.prodCode)) {
    query['ProdCode'] = request.prodCode;
  }
  if (!Util.isUnset(request.recordFlag)) {
    query['RecordFlag'] = request.recordFlag;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sessionTimeout)) {
    query['SessionTimeout'] = request.sessionTimeout;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.ttsConf)) {
    query['TtsConf'] = request.ttsConf;
  }
  if (!Util.isUnset(request.ttsSpeed)) {
    query['TtsSpeed'] = request.ttsSpeed;
  }
  if (!Util.isUnset(request.ttsStyle)) {
    query['TtsStyle'] = request.ttsStyle;
  }
  if (!Util.isUnset(request.ttsVolume)) {
    query['TtsVolume'] = request.ttsVolume;
  }
  if (!Util.isUnset(request.voiceCode)) {
    query['VoiceCode'] = request.voiceCode;
  }
  if (!Util.isUnset(request.voiceCodeParam)) {
    query['VoiceCodeParam'] = request.voiceCodeParam;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendCcoSmartCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request SendCcoSmartCallRequest
 * @return SendCcoSmartCallResponse
 */
async function sendCcoSmartCall(request: SendCcoSmartCallRequest): SendCcoSmartCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendCcoSmartCallWithOptions(request, runtime);
}

model SendCcoSmartCallOperateRequest {
  callId?: string(name='CallId', description='This parameter is required.', example='116012854210^102814279****'),
  command?: string(name='Command', description='This parameter is required.', example='parallelBridge'),
  ownerId?: long(name='OwnerId'),
  param?: string(name='Param', example='Param'),
  prodCode?: string(name='ProdCode', example='aiccs'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model SendCcoSmartCallOperateResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: string(name='Data', example='true'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'),
}

model SendCcoSmartCallOperateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendCcoSmartCallOperateResponseBody(name='body'),
}

/**
 * @param request SendCcoSmartCallOperateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SendCcoSmartCallOperateResponse
 */
async function sendCcoSmartCallOperateWithOptions(request: SendCcoSmartCallOperateRequest, runtime: Util.RuntimeOptions): SendCcoSmartCallOperateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.command)) {
    query['Command'] = request.command;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.param)) {
    query['Param'] = request.param;
  }
  if (!Util.isUnset(request.prodCode)) {
    query['ProdCode'] = request.prodCode;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendCcoSmartCallOperate',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request SendCcoSmartCallOperateRequest
 * @return SendCcoSmartCallOperateResponse
 */
async function sendCcoSmartCallOperate(request: SendCcoSmartCallOperateRequest): SendCcoSmartCallOperateResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendCcoSmartCallOperateWithOptions(request, runtime);
}

model SendHotlineHeartBeatRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  token?: string(name='Token', description='This parameter is required.', example='0079e7a845e373****'),
}

model SendHotlineHeartBeatResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model SendHotlineHeartBeatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendHotlineHeartBeatResponseBody(name='body'),
}

/**
 * @param request SendHotlineHeartBeatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SendHotlineHeartBeatResponse
 */
async function sendHotlineHeartBeatWithOptions(request: SendHotlineHeartBeatRequest, runtime: Util.RuntimeOptions): SendHotlineHeartBeatResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.token)) {
    body['Token'] = request.token;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SendHotlineHeartBeat',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request SendHotlineHeartBeatRequest
 * @return SendHotlineHeartBeatResponse
 */
async function sendHotlineHeartBeat(request: SendHotlineHeartBeatRequest): SendHotlineHeartBeatResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendHotlineHeartBeatWithOptions(request, runtime);
}

model StartAiOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_****'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='1763****'),
}

model StartAiOutboundTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model StartAiOutboundTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartAiOutboundTaskResponseBody(name='body'),
}

/**
 * @summary 启动智能外呼任务
 *
 * @param request StartAiOutboundTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartAiOutboundTaskResponse
 */
async function startAiOutboundTaskWithOptions(request: StartAiOutboundTaskRequest, runtime: Util.RuntimeOptions): StartAiOutboundTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartAiOutboundTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 启动智能外呼任务
 *
 * @param request StartAiOutboundTaskRequest
 * @return StartAiOutboundTaskResponse
 */
async function startAiOutboundTask(request: StartAiOutboundTaskRequest): StartAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return startAiOutboundTaskWithOptions(request, runtime);
}

model StartCallRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  callee?: string(name='Callee', description='This parameter is required.', example='1360987****'),
  caller?: string(name='Caller', description='This parameter is required.', example='906****'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model StartCallResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model StartCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartCallResponseBody(name='body'),
}

/**
 * @param request StartCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartCallResponse
 */
async function startCallWithOptions(request: StartCallRequest, runtime: Util.RuntimeOptions): StartCallResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.callee)) {
    body['Callee'] = request.callee;
  }
  if (!Util.isUnset(request.caller)) {
    body['Caller'] = request.caller;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartCall',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request StartCallRequest
 * @return StartCallResponse
 */
async function startCall(request: StartCallRequest): StartCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return startCallWithOptions(request, runtime);
}

model StartCallV2Request {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  callee?: string(name='Callee', description='This parameter is required.', example='136****1111'),
  caller?: string(name='Caller', description='This parameter is required.', example='9065****'),
  callerType?: int32(name='CallerType', description='This parameter is required.', example='1'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model StartCallV2ResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model StartCallV2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartCallV2ResponseBody(name='body'),
}

/**
 * @param request StartCallV2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartCallV2Response
 */
async function startCallV2WithOptions(request: StartCallV2Request, runtime: Util.RuntimeOptions): StartCallV2Response {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.callee)) {
    body['Callee'] = request.callee;
  }
  if (!Util.isUnset(request.caller)) {
    body['Caller'] = request.caller;
  }
  if (!Util.isUnset(request.callerType)) {
    body['CallerType'] = request.callerType;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartCallV2',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request StartCallV2Request
 * @return StartCallV2Response
 */
async function startCallV2(request: StartCallV2Request): StartCallV2Response {
  var runtime = new Util.RuntimeOptions{};
  return startCallV2WithOptions(request, runtime);
}

model StartChatWorkRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre***'),
}

model StartChatWorkResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='1'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model StartChatWorkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartChatWorkResponseBody(name='body'),
}

/**
 * @summary 修改在线客服为上班状态
 *
 * @param request StartChatWorkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartChatWorkResponse
 */
async function startChatWorkWithOptions(request: StartChatWorkRequest, runtime: Util.RuntimeOptions): StartChatWorkResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartChatWork',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改在线客服为上班状态
 *
 * @param request StartChatWorkRequest
 * @return StartChatWorkResponse
 */
async function startChatWork(request: StartChatWorkRequest): StartChatWorkResponse {
  var runtime = new Util.RuntimeOptions{};
  return startChatWorkWithOptions(request, runtime);
}

model StartHotlineServiceRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='username@example.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model StartHotlineServiceResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: string(name='Data', example='0079e7a845e37334ff'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model StartHotlineServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartHotlineServiceResponseBody(name='body'),
}

/**
 * @param request StartHotlineServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartHotlineServiceResponse
 */
async function startHotlineServiceWithOptions(request: StartHotlineServiceRequest, runtime: Util.RuntimeOptions): StartHotlineServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartHotlineService',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request StartHotlineServiceRequest
 * @return StartHotlineServiceResponse
 */
async function startHotlineService(request: StartHotlineServiceRequest): StartHotlineServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return startHotlineServiceWithOptions(request, runtime);
}

model StartMicroOutboundRequest {
  accountId?: string(name='AccountId', example='223457****'),
  accountType?: string(name='AccountType', example='BUC_TYPE'),
  appName?: string(name='AppName', example='aliyun'),
  calledNumber?: string(name='CalledNumber', example='0571456****'),
  callingNumber?: string(name='CallingNumber', example='1367123****'),
  commandCode?: string(name='CommandCode', example='outBound_Call'),
  extInfo?: string(name='ExtInfo', example='{"caseId":23232****}'),
  ownerId?: long(name='OwnerId'),
  prodCode?: string(name='ProdCode', example='aiccs'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model StartMicroOutboundResponseBody = {
  code?: string(name='Code', example='200'),
  customerInfo?: string(name='CustomerInfo', example='{\\\\"caseId\\\\":2323****}'),
  invokeCmdId?: string(name='InvokeCmdId', example='8883f165-4a0d-4da2-a2d2'),
  invokeCreateTime?: string(name='InvokeCreateTime', example='2019-05-23 17:30:32.525'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
}

model StartMicroOutboundResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartMicroOutboundResponseBody(name='body'),
}

/**
 * @param request StartMicroOutboundRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartMicroOutboundResponse
 */
async function startMicroOutboundWithOptions(request: StartMicroOutboundRequest, runtime: Util.RuntimeOptions): StartMicroOutboundResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountId)) {
    query['AccountId'] = request.accountId;
  }
  if (!Util.isUnset(request.accountType)) {
    query['AccountType'] = request.accountType;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.callingNumber)) {
    query['CallingNumber'] = request.callingNumber;
  }
  if (!Util.isUnset(request.commandCode)) {
    query['CommandCode'] = request.commandCode;
  }
  if (!Util.isUnset(request.extInfo)) {
    query['ExtInfo'] = request.extInfo;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.prodCode)) {
    query['ProdCode'] = request.prodCode;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartMicroOutbound',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request StartMicroOutboundRequest
 * @return StartMicroOutboundResponse
 */
async function startMicroOutbound(request: StartMicroOutboundRequest): StartMicroOutboundResponse {
  var runtime = new Util.RuntimeOptions{};
  return startMicroOutboundWithOptions(request, runtime);
}

model StartTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startNow?: boolean(name='StartNow', example='true'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model StartTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  data?: boolean(name='Data', example='true'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model StartTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartTaskResponseBody(name='body'),
}

/**
 * @summary 立即或定时启动智能外呼任务
 *
 * @param request StartTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartTaskResponse
 */
async function startTaskWithOptions(request: StartTaskRequest, runtime: Util.RuntimeOptions): StartTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startNow)) {
    query['StartNow'] = request.startNow;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 立即或定时启动智能外呼任务
 *
 * @param request StartTaskRequest
 * @return StartTaskResponse
 */
async function startTask(request: StartTaskRequest): StartTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return startTaskWithOptions(request, runtime);
}

model StopAiOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model StopAiOutboundTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model StopAiOutboundTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopAiOutboundTaskResponseBody(name='body'),
}

/**
 * @summary 手动暂停智能外呼任务
 *
 * @param request StopAiOutboundTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopAiOutboundTaskResponse
 */
async function stopAiOutboundTaskWithOptions(request: StopAiOutboundTaskRequest, runtime: Util.RuntimeOptions): StopAiOutboundTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopAiOutboundTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 手动暂停智能外呼任务
 *
 * @param request StopAiOutboundTaskRequest
 * @return StopAiOutboundTaskResponse
 */
async function stopAiOutboundTask(request: StopAiOutboundTaskRequest): StopAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopAiOutboundTaskWithOptions(request, runtime);
}

model StopTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123456'),
}

model StopTaskResponseBody = {
  code?: string(name='Code', example='Ok'),
  data?: boolean(name='Data', example='true'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  success?: boolean(name='Success', example='true'),
}

model StopTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopTaskResponseBody(name='body'),
}

/**
 * @summary 暂停外呼任务
 *
 * @param request StopTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopTaskResponse
 */
async function stopTaskWithOptions(request: StopTaskRequest, runtime: Util.RuntimeOptions): StopTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 暂停外呼任务
 *
 * @param request StopTaskRequest
 * @return StopTaskResponse
 */
async function stopTask(request: StopTaskRequest): StopTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopTaskWithOptions(request, runtime);
}

model SuspendHotlineServiceRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  type?: int32(name='Type', example='1'),
}

model SuspendHotlineServiceResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model SuspendHotlineServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SuspendHotlineServiceResponseBody(name='body'),
}

/**
 * @param request SuspendHotlineServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SuspendHotlineServiceResponse
 */
async function suspendHotlineServiceWithOptions(request: SuspendHotlineServiceRequest, runtime: Util.RuntimeOptions): SuspendHotlineServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SuspendHotlineService',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request SuspendHotlineServiceRequest
 * @return SuspendHotlineServiceResponse
 */
async function suspendHotlineService(request: SuspendHotlineServiceRequest): SuspendHotlineServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return suspendHotlineServiceWithOptions(request, runtime);
}

model SuspendOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  outboundTaskId?: long(name='OutboundTaskId', description='This parameter is required.'),
}

model SuspendOutboundTaskResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SuspendOutboundTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SuspendOutboundTaskResponseBody(name='body'),
}

/**
 * @param request SuspendOutboundTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SuspendOutboundTaskResponse
 */
async function suspendOutboundTaskWithOptions(request: SuspendOutboundTaskRequest, runtime: Util.RuntimeOptions): SuspendOutboundTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.outboundTaskId)) {
    query['OutboundTaskId'] = request.outboundTaskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SuspendOutboundTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request SuspendOutboundTaskRequest
 * @return SuspendOutboundTaskResponse
 */
async function suspendOutboundTask(request: SuspendOutboundTaskRequest): SuspendOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return suspendOutboundTaskWithOptions(request, runtime);
}

model TerminateAiOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_****'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='1763****'),
}

model TerminateAiOutboundTaskResponseBody = {
  code?: string(name='Code', example='OK'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model TerminateAiOutboundTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TerminateAiOutboundTaskResponseBody(name='body'),
}

/**
 * @summary 终止智能外呼任务
 *
 * @param request TerminateAiOutboundTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TerminateAiOutboundTaskResponse
 */
async function terminateAiOutboundTaskWithOptions(request: TerminateAiOutboundTaskRequest, runtime: Util.RuntimeOptions): TerminateAiOutboundTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TerminateAiOutboundTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 终止智能外呼任务
 *
 * @param request TerminateAiOutboundTaskRequest
 * @return TerminateAiOutboundTaskResponse
 */
async function terminateAiOutboundTask(request: TerminateAiOutboundTaskRequest): TerminateAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return terminateAiOutboundTaskWithOptions(request, runtime);
}

model TransferCallToSkillGroupRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='username@example.com'),
  callId?: string(name='CallId', example='7719786'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  connectionId?: string(name='ConnectionId', example='7719788'),
  holdConnectionId?: string(name='HoldConnectionId', example='0'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  isSingleTransfer?: boolean(name='IsSingleTransfer', example='true'),
  jobId?: string(name='JobId', example='7719787'),
  skillGroupId?: long(name='SkillGroupId', description='This parameter is required.', example='356543'),
  type?: int32(name='Type', example='1'),
}

model TransferCallToSkillGroupResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model TransferCallToSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TransferCallToSkillGroupResponseBody(name='body'),
}

/**
 * @param request TransferCallToSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TransferCallToSkillGroupResponse
 */
async function transferCallToSkillGroupWithOptions(request: TransferCallToSkillGroupRequest, runtime: Util.RuntimeOptions): TransferCallToSkillGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.callId)) {
    body['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionId)) {
    body['ConnectionId'] = request.connectionId;
  }
  if (!Util.isUnset(request.holdConnectionId)) {
    body['HoldConnectionId'] = request.holdConnectionId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.isSingleTransfer)) {
    body['IsSingleTransfer'] = request.isSingleTransfer;
  }
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.skillGroupId)) {
    body['SkillGroupId'] = request.skillGroupId;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'TransferCallToSkillGroup',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request TransferCallToSkillGroupRequest
 * @return TransferCallToSkillGroupResponse
 */
async function transferCallToSkillGroup(request: TransferCallToSkillGroupRequest): TransferCallToSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return transferCallToSkillGroupWithOptions(request, runtime);
}

model UpdateAgentRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='123@123.com'),
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  displayName?: string(name='DisplayName', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  skillGroupId?: [ long ](name='SkillGroupId'),
  skillGroupIdList?: [ long ](name='SkillGroupIdList'),
}

model UpdateAgentResponseBody = {
  code?: string(name='Code', example='Success'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model UpdateAgentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAgentResponseBody(name='body'),
}

/**
 * @param request UpdateAgentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAgentResponse
 */
async function updateAgentWithOptions(request: UpdateAgentRequest, runtime: Util.RuntimeOptions): UpdateAgentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accountName)) {
    body['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.displayName)) {
    body['DisplayName'] = request.displayName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.skillGroupId)) {
    body['SkillGroupId'] = request.skillGroupId;
  }
  if (!Util.isUnset(request.skillGroupIdList)) {
    body['SkillGroupIdList'] = request.skillGroupIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAgent',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'PUT',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request UpdateAgentRequest
 * @return UpdateAgentResponse
 */
async function updateAgent(request: UpdateAgentRequest): UpdateAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAgentWithOptions(request, runtime);
}

model UpdateAiOutboundTaskRequest {
  concurrentRate?: int32(name='ConcurrentRate', example='10'),
  description?: string(name='Description'),
  executionTime?: string(name='ExecutionTime', description='This parameter is required.', example='{"TUESDAY":[{"start":"06:00","end":"06:05"}],"MONDAY":[{"start":"09:00","end":"18:00"},{"start":"20:30","end":"21:45"},{"start":"22:30","end":"22:50"}],"WEDNESDAY":[{"start":"09:00","end":"18:00"}],"THURSDAY":[{"start":"09:00","end":"18:00"}],"FRIDAY":[{"start":"09:00","end":"18:00"}],"SATURDAY":[{"start":"09:00","end":"18:00"}],"SUNDAY":[{"start":"17:00","end":"23:45"}]}'),
  forecastCallRate?: float(name='ForecastCallRate', example='1.2'),
  handlerId?: long(name='HandlerId', description='This parameter is required.', example='123'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  name?: string(name='Name', description='This parameter is required.', example='xx外呼任务'),
  numRepeated?: int32(name='NumRepeated', description='This parameter is required.', example='1'),
  outboundNums?: [ string ](name='OutboundNums', description='This parameter is required.'),
  recallRule?: {
    count?: int32(name='Count', example='2'),
    interval?: int32(name='Interval', example='5'),
  }(name='RecallRule'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123'),
}

model UpdateAiOutboundTaskShrinkRequest {
  concurrentRate?: int32(name='ConcurrentRate', example='10'),
  description?: string(name='Description'),
  executionTime?: string(name='ExecutionTime', description='This parameter is required.', example='{"TUESDAY":[{"start":"06:00","end":"06:05"}],"MONDAY":[{"start":"09:00","end":"18:00"},{"start":"20:30","end":"21:45"},{"start":"22:30","end":"22:50"}],"WEDNESDAY":[{"start":"09:00","end":"18:00"}],"THURSDAY":[{"start":"09:00","end":"18:00"}],"FRIDAY":[{"start":"09:00","end":"18:00"}],"SATURDAY":[{"start":"09:00","end":"18:00"}],"SUNDAY":[{"start":"17:00","end":"23:45"}]}'),
  forecastCallRate?: float(name='ForecastCallRate', example='1.2'),
  handlerId?: long(name='HandlerId', description='This parameter is required.', example='123'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='agent_***'),
  name?: string(name='Name', description='This parameter is required.', example='xx外呼任务'),
  numRepeated?: int32(name='NumRepeated', description='This parameter is required.', example='1'),
  outboundNumsShrink?: string(name='OutboundNums', description='This parameter is required.'),
  recallRuleShrink?: string(name='RecallRule'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='123'),
}

model UpdateAiOutboundTaskResponseBody = {
  code?: string(name='Code', example='ok'),
  message?: string(name='Message', example='ok'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model UpdateAiOutboundTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAiOutboundTaskResponseBody(name='body'),
}

/**
 * @summary 更新智能外呼任务（预测式外呼、自动外呼）
 *
 * @param tmpReq UpdateAiOutboundTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAiOutboundTaskResponse
 */
async function updateAiOutboundTaskWithOptions(tmpReq: UpdateAiOutboundTaskRequest, runtime: Util.RuntimeOptions): UpdateAiOutboundTaskResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAiOutboundTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.outboundNums)) {
    request.outboundNumsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.outboundNums, 'OutboundNums', 'json');
  }
  if (!Util.isUnset(tmpReq.recallRule)) {
    request.recallRuleShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.recallRule, 'RecallRule', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.concurrentRate)) {
    query['ConcurrentRate'] = request.concurrentRate;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.executionTime)) {
    query['ExecutionTime'] = request.executionTime;
  }
  if (!Util.isUnset(request.forecastCallRate)) {
    query['ForecastCallRate'] = request.forecastCallRate;
  }
  if (!Util.isUnset(request.handlerId)) {
    query['HandlerId'] = request.handlerId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.numRepeated)) {
    query['NumRepeated'] = request.numRepeated;
  }
  if (!Util.isUnset(request.outboundNumsShrink)) {
    query['OutboundNums'] = request.outboundNumsShrink;
  }
  if (!Util.isUnset(request.recallRuleShrink)) {
    query['RecallRule'] = request.recallRuleShrink;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAiOutboundTask',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新智能外呼任务（预测式外呼、自动外呼）
 *
 * @param request UpdateAiOutboundTaskRequest
 * @return UpdateAiOutboundTaskResponse
 */
async function updateAiOutboundTask(request: UpdateAiOutboundTaskRequest): UpdateAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAiOutboundTaskWithOptions(request, runtime);
}

model UpdateDepartmentRequest {
  departmentId?: long(name='DepartmentId', description='This parameter is required.', example='123456'),
  departmentName?: string(name='DepartmentName', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
}

model UpdateDepartmentResponseBody = {
  code?: string(name='Code', example='200'),
  data?: boolean(name='Data', example='true'),
  httpStatusCode?: long(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='98B032F5-6473-4EAC-8BA8-C28993513A1'),
  success?: boolean(name='Success', example='true'),
}

model UpdateDepartmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDepartmentResponseBody(name='body'),
}

/**
 * @summary 更新部门信息
 *
 * @param request UpdateDepartmentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDepartmentResponse
 */
async function updateDepartmentWithOptions(request: UpdateDepartmentRequest, runtime: Util.RuntimeOptions): UpdateDepartmentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.departmentId)) {
    query['DepartmentId'] = request.departmentId;
  }
  if (!Util.isUnset(request.departmentName)) {
    query['DepartmentName'] = request.departmentName;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDepartment',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新部门信息
 *
 * @param request UpdateDepartmentRequest
 * @return UpdateDepartmentResponse
 */
async function updateDepartment(request: UpdateDepartmentRequest): UpdateDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDepartmentWithOptions(request, runtime);
}

model UpdateOuterAccountRequest {
  avatar?: string(name='Avatar', example='http://****'),
  ext?: string(name='Ext'),
  outerAccountId?: string(name='OuterAccountId', description='This parameter is required.', example='123456'),
  outerAccountName?: string(name='OuterAccountName'),
  outerAccountType?: string(name='OuterAccountType', description='This parameter is required.', example='alipay'),
  outerDepartmentId?: string(name='OuterDepartmentId', example='3'),
  outerDepartmentType?: string(name='OuterDepartmentType', example='type_invalid'),
  outerGroupIds?: string(name='OuterGroupIds', example='["222","333","444"]'),
  outerGroupType?: string(name='OuterGroupType', example='mybank'),
  realName?: string(name='RealName'),
}

model UpdateOuterAccountResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='true'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model UpdateOuterAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateOuterAccountResponseBody(name='body'),
}

/**
 * @param request UpdateOuterAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateOuterAccountResponse
 */
async function updateOuterAccountWithOptions(request: UpdateOuterAccountRequest, runtime: Util.RuntimeOptions): UpdateOuterAccountResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateOuterAccount',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request UpdateOuterAccountRequest
 * @return UpdateOuterAccountResponse
 */
async function updateOuterAccount(request: UpdateOuterAccountRequest): UpdateOuterAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateOuterAccountWithOptions(request, runtime);
}

model UpdateSkillGroupRequest {
  clientToken?: string(name='ClientToken', example='46c1341e-2648-447a-9b11-70b6a298d94d'),
  description?: string(name='Description'),
  displayName?: string(name='DisplayName'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ccc_xp_pre-cn-***'),
  skillGroupId?: long(name='SkillGroupId', description='This parameter is required.', example='123456'),
  skillGroupName?: string(name='SkillGroupName'),
}

model UpdateSkillGroupResponseBody = {
  code?: string(name='Code', example='Success'),
  message?: string(name='Message', example='xxxx'),
  requestId?: string(name='RequestId', example='EE338D98-9BD3-4413-B165'),
  success?: boolean(name='Success', example='true'),
}

model UpdateSkillGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSkillGroupResponseBody(name='body'),
}

/**
 * @param request UpdateSkillGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSkillGroupResponse
 */
async function updateSkillGroupWithOptions(request: UpdateSkillGroupRequest, runtime: Util.RuntimeOptions): UpdateSkillGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.displayName)) {
    query['DisplayName'] = request.displayName;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.skillGroupId)) {
    query['SkillGroupId'] = request.skillGroupId;
  }
  if (!Util.isUnset(request.skillGroupName)) {
    query['SkillGroupName'] = request.skillGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSkillGroup',
    version = '2019-10-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request UpdateSkillGroupRequest
 * @return UpdateSkillGroupResponse
 */
async function updateSkillGroup(request: UpdateSkillGroupRequest): UpdateSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSkillGroupWithOptions(request, runtime);
}

